Workorder.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace addons\qingdongams\validate;
  3. use think\Validate;
  4. //工单
  5. class Workorder extends Validate {
  6. /**
  7. * 验证规则
  8. */
  9. protected $rule = [
  10. 'create_staff_id' => 'require|number',
  11. 'owner_staff_id' => 'number',
  12. 'customer_id' => 'number',
  13. 'contacts_id' => 'number',
  14. 'workorder_number' => 'require|max:50',
  15. 'workorder_type' => 'max:64',
  16. 'address' => 'max:64',
  17. 'address_detail' => 'max:128',
  18. 'lng' => 'max:32',
  19. 'lat' => 'max:32',
  20. 'customer_product_id' => 'max:64',
  21. 'title' => 'require|length:4,50',
  22. 'priority' => 'require',
  23. ];
  24. /**
  25. * 提示消息
  26. */
  27. protected $message = [];
  28. /**
  29. * 字段描述
  30. */
  31. protected $field = [
  32. 'create_staff_id' => '员工',
  33. 'owner_staff_id' => '员工',
  34. 'customer_id' => '所属客户',
  35. 'contacts_id' => '所属联系人',
  36. 'workorder_number' => '工单编号',
  37. 'workorder_type' => '工单类型',
  38. 'address' => '所在地区',
  39. 'address_detail' => '详细地址',
  40. 'customer_product_id' => '客户所属产品',
  41. 'title' => '工单标题',
  42. ];
  43. /**
  44. * 验证场景
  45. */
  46. protected $scene = [
  47. 'create' => [
  48. 'contacts_id',
  49. 'workorder_number',
  50. 'workorder_type',
  51. 'address',
  52. 'address_detail',
  53. 'customer_product_id',
  54. ],
  55. 'edit' => [],
  56. ];
  57. }