1234567891011121314151617181920212223242526272829 |
- <?php
- namespace app\admin\validate\package;
- use think\Validate;
- class PackageGoodsCategoryValidate extends Validate
- {
- protected $rule = [
- 'category_id' => 'require',
- 'category_name' => 'require',
- 'category_title' => 'require',
- 'category_num' => 'require',
- ];
- protected $message = [
- 'category_name.require' => '分类名称不能为空',
- 'category_id.require' => 'id不能为空',
- 'category_title.require' => '简介不能为空',
- 'category_num.require' => '服务数量不能为空',
- ];
- //场景
- protected $scene = [
- 'add' => ['category_name','category_title','category_num'],
- 'update' => ['category_id','category_name','category_title','category_num'],
- 'info' => ['category_id'],
- 'del' => ['category_id']
- ];
- }
|