12345678910111213141516171819202122232425262728 |
- <?php
- namespace app\admin\validate\index;
- use think\Validate;
- class ConfigValidate extends Validate
- {
- //定义规则
- protected $rule = [
- 'classify_name' => 'require',
- 'classify_key' => 'require',
- 'classify_id' => 'require',
- ];
- //定义描述
- protected $message = [
- 'classify_name.require' => '分类名称不能为空',
- 'classify_key.require' => '分类键名不能为空',
- 'classify_id.require' => '分类编号不能为空'
- ];
- //定义场景
- protected $scene = [
- 'add' => ['classify_name','classify_key'],
- 'up' => ['classify_name','classify_key', 'classify_id'],
- 'del_up' => ['classify_id'],
- ];
- }
|