|
@@ -20,6 +20,7 @@ class User extends Validate
|
|
'phoneNumber' => 'require',
|
|
'phoneNumber' => 'require',
|
|
'code' => 'require|number|min:4',
|
|
'code' => 'require|number|min:4',
|
|
'type' => 'require|in:1,2',
|
|
'type' => 'require|in:1,2',
|
|
|
|
+ 'sex' => 'require|in:0,1,2'
|
|
];
|
|
];
|
|
|
|
|
|
protected $message = [
|
|
protected $message = [
|
|
@@ -30,9 +31,13 @@ class User extends Validate
|
|
'code.min' => '短信验证码长度不得低于4',
|
|
'code.min' => '短信验证码长度不得低于4',
|
|
'type.require' => '类型必须',
|
|
'type.require' => '类型必须',
|
|
'type.in' => '类型数值错误',
|
|
'type.in' => '类型数值错误',
|
|
|
|
+ 'sex.require' => '性别必须',
|
|
|
|
+ 'sex.in' => '性别数值错误',
|
|
];
|
|
];
|
|
|
|
+
|
|
protected $scene = [
|
|
protected $scene = [
|
|
'send_code' => ['phoneNumber'],
|
|
'send_code' => ['phoneNumber'],
|
|
'login' => ['phoneNumber', 'code', 'type'],
|
|
'login' => ['phoneNumber', 'code', 'type'],
|
|
|
|
+ 'update_user' => ['username', 'sex']
|
|
];
|
|
];
|
|
}
|
|
}
|