You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
639 B

7 years ago
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. class User extends Validate
  5. {
  6. // 验证规则
  7. protected $rule = [
  8. ['id', 'require|number','ID必填|ID必须是数字'],
  9. ['user_name', 'require|max:60','用户名必填|用户名不能超过60个字符'],
  10. ['sex', 'in:0,1,2','性别1男2女'],
  11. ['password', 'require|max:50','密码必填|密码不能超过50个字符'],
  12. ['status', 'in:1,2,3','用户状态 1正常状态 2 删除至回收站 3锁定'],
  13. ];
  14. protected $scene = [
  15. 'add' => ['user_name', 'text', 'status', 'result'],
  16. 'del' => ['id'],
  17. ];
  18. }