Customer.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. namespace addons\qingdongams\validate;
  3. use think\Validate;
  4. class Customer extends Validate {
  5. /**
  6. * 验证规则
  7. */
  8. protected $rule = [
  9. 'create_staff_id' => 'require|number',
  10. 'owner_staff_id' => 'require|number',
  11. 'name' => 'require|max:50',
  12. 'subname' => 'max:50',
  13. 'level' => 'number|between:0,5',
  14. 'contract_status' => 'number|between:0,1',
  15. 'industry' => 'max:50',
  16. 'source' => 'max:50',
  17. 'follow' => 'max:50',
  18. 'address' => 'max:100',
  19. 'address_detail' => 'max:100',
  20. 'parent_id' => 'number',
  21. 'remark' => 'max:250',
  22. 'location' => 'max:128',
  23. 'lng' => 'max:32',
  24. 'lat' => 'max:32',
  25. 'number' => 'max:32',
  26. 't_yield' => 'max:32',
  27. 'p_yield' => 'max:32',
  28. 'scale' => 'max:32',
  29. ];
  30. /**
  31. * 提示消息
  32. */
  33. protected $message = [];
  34. /**
  35. * 字段描述
  36. */
  37. protected $field = [
  38. 'create_staff_id' => '员工',
  39. 'owner_staff_id' => '员工',
  40. 'name' => '客户名称',
  41. 'subname' => '助记名称',
  42. 'level' => '客户星级',
  43. 'industry' => '所属行业',
  44. 'follow' => '客户状态',
  45. 'source' => '客户来源',
  46. 'address' => '所在地区',
  47. 'address_detail' => '详细地址',
  48. 'parent_id' => '上级公司',
  49. 'remark' => '备注',
  50. 'contract_status' => '成交状态',
  51. ];
  52. /**
  53. * 验证场景
  54. */
  55. protected $scene = [
  56. 'create' => [
  57. 'name',
  58. 'subname',
  59. 'level',
  60. 'industry',
  61. 'source',
  62. 'follow',
  63. 'address',
  64. 'address_detail',
  65. 'parent_id',
  66. 'remark',
  67. 'location',
  68. 'lng',
  69. 'lat',
  70. 'number',
  71. 't_yield',
  72. 'p_yield',
  73. 'scale',
  74. ],
  75. 'edit' => [
  76. 'name',
  77. 'subname',
  78. 'level',
  79. 'industry',
  80. 'source',
  81. 'follow',
  82. 'address',
  83. 'address_detail',
  84. 'remark',
  85. 'location',
  86. 'lng',
  87. 'lat',
  88. 'number',
  89. 't_yield',
  90. 'p_yield',
  91. 'scale',
  92. ],
  93. ];
  94. }