GroupServiceWorkValidate.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. namespace app\workerapi\validate;
  3. use app\common\validate\BaseValidate;
  4. /**
  5. * GroupServiceWork验证器
  6. * Class GroupServiceWorkValidate
  7. * @package app\workerapi\validate\works
  8. */
  9. class GroupServiceWorkValidate 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. 'work_status' => 'require',
  21. 'service_status' => 'require',
  22. 'appointment_time' => 'require|dateFormat:Y/m/d H:i:s',
  23. 'finished_images'=>'require',
  24. 'work_images'=>'require',
  25. 'code' => 'require',
  26. ];
  27. /**
  28. * 参数描述
  29. * @var string[]
  30. */
  31. protected $field = [
  32. 'id' => 'id',
  33. 'work_sn' => '工单编号',
  34. 'mobile' => '手机号',
  35. 'address' => '客户地址',
  36. 'work_status' => '工单状态',
  37. 'service_status' => '订单服务状态',
  38. 'appointment_time' => '预约上门时间',
  39. 'finished_time' => '结单时间',
  40. 'finished_images'=>'完结服务拍照',
  41. 'work_images'=>'工作拍照',
  42. 'code' => '工单验证码'
  43. ];
  44. /**
  45. * 领取场景
  46. * @return ServiceWorkValidate
  47. */
  48. public function sceneDetail()
  49. {
  50. return $this->only(['*']);
  51. }
  52. /**
  53. * 确认上门场景
  54. * @return ServiceWorkValidate
  55. */
  56. public function sceneDoor()
  57. {
  58. return $this->only(['work_sn','work_images']);
  59. }
  60. public function sceneFinished()
  61. {
  62. return $this->only(['work_sn','finished_images','code']);
  63. }
  64. public function sceneAgainDoor()
  65. {
  66. return $this->only(['work_sn','appointment_time']);
  67. }
  68. }