wupengfei 3 years ago
parent
commit
23047f0c67
1 changed files with 2 additions and 3 deletions
  1. 2 3
      application/admin/validate/User.php

+ 2 - 3
application/admin/validate/User.php

@@ -15,7 +15,7 @@ class User extends Validate
         'password' => 'regex:\S{6,32}',
         'email'    => 'require|email|unique:user',
         'mobile'   => 'unique:user',
-        'level'    => 'require|number|max:6|min:0'
+        'level'    => 'require|number|between:0,6'
     ];
 
     /**
@@ -27,8 +27,7 @@ class User extends Validate
      * 提示消息
      */
     protected $message = [
-        'level.max'  => '等级最高6级',
-        'level.min'  => '等级最低0级',
+        'level.between'  => '等级最高6级',
         'level.number'  => '等级必须是数字',
     ];
     /**