You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
1.9 KiB
97 lines
1.9 KiB
<?php
|
|
|
|
namespace addons\qingdong\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'
|
|
],
|
|
];
|
|
}
|
|
|