Blame view

addons/antis/validate/Customer.php 2.05 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
98
  <?php

  

  namespace addons\antis\validate;

  

  use think\Validate;

  

  class Customer extends Validate {

  	/**

  	 * 验证规则

  	 */

  	protected $rule = [

  		'create_staff_id' => 'require|number',

  		'owner_staff_id'  => 'require|number',

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

  		'subname'         => 'max:50',

  		'level'           => 'number|between:0,5',

  		'contract_status' => 'number|between:0,1',

  		'industry'        => 'max:50',

  		'source'          => 'max:50',

  		'follow'          => 'max:50',

  		'address'         => 'max:100',

  		'address_detail'  => 'max:100',

  		'parent_id'       => 'number',

  		'remark'          => 'max:250',

  		'location'        => 'max:128',

  		'lng'             => 'max:32',

  		'lat'             => 'max:32',

  		'number'          => 'max:32',

  		't_yield'         => 'max:32',

  		'p_yield'         => 'max:32',

  		'scale'           => 'max:32',

  	];

  	/**

  	 * 提示消息

  	 */

  	protected $message = [];

  	/**

  	 * 字段描述

  	 */

  	protected $field = [

  		'create_staff_id' => '员工',

  		'owner_staff_id'  => '员工',

  		'name'            => '客户名称',

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

  		'level'           => '客户星级',

  		'industry'        => '所属行业',

  		'follow'          => '客户状态',

  		'source'          => '客户来源',

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

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

  		'parent_id'       => '上级公司',

  		'remark'          => '备注',

  		'contract_status'          => '成交状态',

  

  	];

  	/**

  	 * 验证场景

  	 */

  	protected $scene = [

  		'create' => [

  			'name',

  			'subname',

  			'level',

  			'industry',

  			'source',

  			'follow',

  			'address',

  			'address_detail',

  			'parent_id',

  			'remark',

  			'location',

  			'lng',

  			'lat',

  			'number',

  			't_yield',

  			'p_yield',

  			'scale',

  		],

  		'edit'   => [

  			'name',

  			'subname',

  			'level',

  			'industry',

  			'source',

  			'follow',

  			'address',

  			'address_detail',

  			'remark',

  			'location',

  			'lng',

  			'lat',

  			'number',

  			't_yield',

  			'p_yield',

  			'scale',

  		],

  	];

  }