Blame view

addons/antis/validate/Contacts.php 1.98 KB
2db47680   hexiaodong   chore: 初始提交 php 遗...
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
  <?php

  

  namespace addons\antis\validate;

  

  use think\Validate;

  //l联系人

  class Contacts extends Validate {

  	/**

  	 * 验证规则

  	 */

  	protected $rule = [

  		'create_staff_id' => 'require|number',

  		'owner_staff_id'  => 'require|number',

  		'customer_id'     => 'require|number',

  

  		'name'           => 'require|max:50',

  		'mobile'         => 'max:32',

  		'subname'        => 'max:50',

  		'sex'            => 'number|between:0,2',

  		'role'           => 'max:32',

  		'post'           => 'max:32',

  		'birthday'       => 'max:32',

  		'email'          => 'email|max:32',

  		'telephone'      => 'max:32',

  		'wechat'         => 'max:32',

  		'qq'             => 'max:32',

  		'address'        => 'max:64',

  		'address_detail' => 'max:64',

  		'remarks'        => 'max:250',

  

  	];

  	/**

  	 * 提示消息

  	 */

  	protected $message = [];

  	/**

  	 * 字段描述

  	 */

  	protected $field = [

  		'create_staff_id' => '员工',

  		'owner_staff_id'  => '员工',

  		'customer_id'     => '所属客户',

  		'name'            => '联系人名称',

  		'subname'         => '助记名称',

  		'mobile'          => '手机号',

  		'sex'             => '性别',

  		'role'            => '角色',

  		'post'            => '职务',

  		'birthday'        => '生日',

  		'email'           => '邮箱',

  		'telephone'       => '座机',

  		'wechat'          => '微信号',

  		'qq'              => 'qq',

  		'address'         => '所在地区',

  		'address_detail'  => '详细地址',

  		'remarks'         => '备注信息',

  

  

  	];

  	/**

  	 * 验证场景

  	 */

  	protected $scene = [

  		'create' => [

  			'name',

  			'subname',

  			'mobile',

  			'sex',

  			'role',

  			'post',

  			'birthday',

  			'email',

  			'telephone',

  			'wechat',

  			'qq',

  			'address',

  			'address_detail',

  			'remarks'

  		],

  		'edit'   => [

  			'name',

  			'subname',

  			'mobile',

  			'sex',

  			'role',

  			'post',

  			'birthday',

  			'email',

  			'telephone',

  			'wechat',

  			'qq',

  			'address',

  			'address_detail',

  			'remarks'

  		],

  	];

  }