1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace addons\qingdongams\validate;
- use think\Validate;
- //工单
- class Workorder extends Validate {
- /**
- * 验证规则
- */
- protected $rule = [
- 'create_staff_id' => 'require|number',
- 'owner_staff_id' => 'number',
- 'customer_id' => 'number',
- 'contacts_id' => 'number',
- 'workorder_number' => 'require|max:50',
- 'workorder_type' => 'max:64',
- 'address' => 'max:64',
- 'address_detail' => 'max:128',
- 'lng' => 'max:32',
- 'lat' => 'max:32',
- 'customer_product_id' => 'max:64',
- 'title' => 'require|length:4,50',
- 'priority' => 'require',
- ];
- /**
- * 提示消息
- */
- protected $message = [];
- /**
- * 字段描述
- */
- protected $field = [
- 'create_staff_id' => '员工',
- 'owner_staff_id' => '员工',
- 'customer_id' => '所属客户',
- 'contacts_id' => '所属联系人',
- 'workorder_number' => '工单编号',
- 'workorder_type' => '工单类型',
- 'address' => '所在地区',
- 'address_detail' => '详细地址',
- 'customer_product_id' => '客户所属产品',
- 'title' => '工单标题',
- ];
- /**
- * 验证场景
- */
- protected $scene = [
- 'create' => [
- 'contacts_id',
- 'workorder_number',
- 'workorder_type',
- 'address',
- 'address_detail',
- 'customer_product_id',
- ],
- 'edit' => [],
- ];
- }
|