AgentUser.php
2.0 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
56
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2020/6/29
* Time: 15:50
*/
namespace app\web\validate;
use app\common\validate\BaseValidate;
class AgentUser extends BaseValidate
{
protected $rule = [
'id|唯一标识'=>'require|number|min:1',
'org_code' => 'require|number|length:8',
'agent_account' => 'require|alphaDash|length:6,20',
'password' => 'require|alphaDash|length:6,20|confirm:password2',
'agent_phone' => 'require|phone',
'agent_address|代理地址' => 'chsDash|length:0:80',
'agent_cname|代理姓名' => 'require|chs|length:2,12',
'agent_ename|代理英文名' => 'require|chs|length:2,12',
'bank_card_num|银行卡号' => 'require|number|length:16,19',
'bank|开户行' => 'require|chsDash|length:4,20',
'bank_address' => 'require',
'id_number' => 'require|number|length:18',
];
protected $message = [
'org_code' => '请选择所属机构',
'agent_account' => '账号必须为长度6-20的字母数字下划线_及破折号-',
'password.require' => '密码不能为空',
'password.alphaDash' => '密码只能为字母数字下划线_及破折号-',
'password.length' => '密码长度必须为6-20',
'password.confirm' => '两次密码必须相同',
'agent_phone.require' => '手机号必填',
'agent_phone.number' => '手机号必须是数字',
'agent_phone.length' => '手机号长度为11',
];
protected $scene = [
'add' => [
'org_code','agent_account','password'=>'require|alphaDash|length:6,20|confirm:password2','agent_phone','agent_address','agent_cname','agent_ename','bank_card_num',
'bank','bank_address','id_number'
],
'update' => [
'id','org_code','agent_account','password'=>'alphaDash|length:6,20|confirm:password2','agent_phone','agent_address','agent_cname','agent_ename','bank_card_num',
'bank','bank_address','id_number'
]
];
}