UserValidate.php 1003 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace app\admin\validate\sys_manage;
  3. use support\Validate;
  4. class UserValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'join_user_role_id' => 'integer',
  8. 'join_user_dept_id' => 'integer',
  9. 'user_status|状态' => 'require|in:ACTIVED,DISABLED,PENDING',
  10. 'user_category|分类' => 'require|in:EMPLOY,OTHER',
  11. 'user_name|姓名' => 'require',
  12. 'user_login_name|登录名' => 'require|alphaDash',
  13. 'user_login_pass|登录密码' => 'require',
  14. 'user_mobile|联系电话' => 'mobile'
  15. ];
  16. protected $message = [];
  17. protected $scene = [
  18. 'add' => ['join_user_role_id','join_user_dept_id','user_status','user_category','user_name','user_login_name','user_login_pass','user_login_bcrypt','user_mobile'],
  19. 'update' => ['join_user_role_id','join_user_dept_id','user_status','user_category','user_name'],
  20. 'update_status' => ['user_status'],
  21. ];
  22. }