ServiceWorkValidate.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?php
  2. namespace app\workerapi\validate;
  3. use app\common\validate\BaseValidate;
  4. /**
  5. * ServiceWork验证器
  6. * Class ServiceWorkValidate
  7. * @package app\workerapi\validate\works
  8. */
  9. class ServiceWorkValidate extends BaseValidate
  10. {
  11. /**
  12. * 设置校验规则
  13. * @var string[]
  14. */
  15. protected $rule = [
  16. 'id' => 'require',
  17. 'work_sn' => 'require',
  18. 'mobile' => 'require',
  19. 'address' => 'require',
  20. 'title' => 'require',
  21. 'category_type' => 'require',
  22. 'goods_category_ids' => 'require',
  23. 'goods_category_id' => 'require',
  24. 'base_service_fee' => 'require',
  25. 'service_fee' => 'require',
  26. 'work_status' => 'require',
  27. 'service_status' => 'require',
  28. 'dispatch_time' => 'require',
  29. 'receive_time' => 'require',
  30. 'appointment_time' => 'require|dateFormat:Y/m/d H:i:s',
  31. 'finished_time' => 'require',
  32. 'master_worker_id' => 'require',
  33. 'order_sn'=>'require',
  34. 'amount'=>'require',
  35. 'finished_images'=>'require',
  36. 'work_images'=>'require',
  37. ];
  38. /**
  39. * 参数描述
  40. * @var string[]
  41. */
  42. protected $field = [
  43. 'id' => 'id',
  44. 'work_sn' => '工单编号',
  45. 'mobile' => '手机号',
  46. 'address' => '客户地址',
  47. 'title' => '工单名称',
  48. 'category_type' => '服务类别',
  49. 'goods_category_ids' => '服务类目',
  50. 'goods_category_id' => '服务产品',
  51. 'base_service_fee' => '基础服务费',
  52. 'service_fee' => '服务费用',
  53. 'work_status' => '工单状态',
  54. 'service_status' => '订单服务状态',
  55. 'dispatch_time' => '派单时间',
  56. 'receive_time' => '领单时间',
  57. 'appointment_time' => '预约上门时间',
  58. 'finished_time' => '结单时间',
  59. 'master_worker_id' => '工程师',
  60. 'order_sn'=>'未获取到扫码信息',
  61. 'amount'=>'报价',
  62. 'finished_images'=>'完结服务拍照',
  63. 'work_images'=>'工作拍照'
  64. ];
  65. /**
  66. * 领取场景
  67. * @return ServiceWorkValidate
  68. */
  69. public function scenePick()
  70. {
  71. return $this->only(['work_sn']);
  72. }
  73. /**
  74. * 领取场景
  75. * @return ServiceWorkValidate
  76. */
  77. public function sceneDetail()
  78. {
  79. return $this->only(['*']);
  80. }
  81. /**
  82. * 预约上门场景
  83. * @return ServiceWorkValidate
  84. */
  85. public function sceneAppoint()
  86. {
  87. return $this->only(['work_sn','address','appointment_time']);
  88. }
  89. /**
  90. * 确认上门场景
  91. * @return ServiceWorkValidate
  92. */
  93. public function sceneDoor()
  94. {
  95. return $this->only(['work_sn','order_sn']);
  96. }
  97. public function scenePrice()
  98. {
  99. return $this->only(['work_sn','amount','work_images']);
  100. }
  101. public function sceneFinished()
  102. {
  103. return $this->only(['work_sn','finished_images']);
  104. }
  105. public function sceneSpare()
  106. {
  107. return $this->only(['work_sn']);
  108. }
  109. public function sceneSubmitAppointment()
  110. {
  111. return $this->only(['work_sn']);
  112. }
  113. }