User.php
1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2020/6/29
* Time: 15:50
*/
namespace app\web\validate;
use app\common\validate\BaseValidate;
class User extends BaseValidate
{
protected $rule = [
'uid'=>'require|number|min:1',
'org_code' => 'require|number|length:8',
'login_account' => 'require|alphaDash|length:6,20',
'password' => 'require|alphaDash|length:6,20|confirm:password2',
'user_phone' => 'require|phone',//等待自定义规则
'user_address' => 'chsDash|length:0:80',
'user_cname' => 'require|chs|length:2:12',
'invalid_flag' => 'number|min:1',
'user_sex' => 'require|number|in:"0,1"',
'bank_card_num|银行卡号' => 'require|number|length:16:19',
'bank|开户行' => 'require|chsDash|length:4:20',
'bank_address' => '',
'id_number' => '',
];
protected $message = [
'org_code' => '请选择所属机构',
'login_account' => '账号必须为长度6-20的字母数字下划线_及破折号-',
'password.require' => '密码不能为空',
'password.alphaDash' => '密码只能为字母数字下划线_及破折号-',
'password.length' => '密码长度必须为6-20',
'password.confirm' => '两次密码必须相同',
'user_phone.require' => '手机号必填',
'user_phone.number' => '手机号必须是数字',
'user_phone.length' => '手机号长度为11',
];
protected $scene = [
'add' => [
'org_code','login_account','password','user_phone','user_address','user_cname'
],
'update' => [
'id','org_code','login_account','password','user_phone','user_address','user_cname'
]
];
}