123456789101112131415161718192021222324252627 |
- <?php
- namespace app\admin\validate\intelligence;
- use think\Validate;
- class UserValidate extends Validate
- {
- protected $rule = [
- 'category_name' => 'require|max:20',
- 'equipment_id' => 'require',
- 'category_pid' => 'require',
- ];
- protected $message = [
- 'category_name.require' => '分类名称不能为空',
- 'equipment_id.require' => '会员智能设备id不能为空',
- 'category_name.max' => '分类名称不能超过20字',
- 'category_pid' => '父级id不能为空',
- ];
- //场景
- protected $scene = [
- 'create' => ['category_name','category_pid'],
- 'update' => ['category_id'],
- 'info' => ['equipment_id']
- ];
- }
|