GroupServiceWorkValidate.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. 'remark' => 'require',
  27. ];
  28. /**
  29. * 参数描述
  30. * @var string[]
  31. */
  32. protected $field = [
  33. 'id' => 'id',
  34. 'work_sn' => '工单编号',
  35. 'mobile' => '手机号',
  36. 'address' => '客户地址',
  37. 'work_status' => '工单状态',
  38. 'service_status' => '订单服务状态',
  39. 'appointment_time' => '预约上门时间',
  40. 'finished_time' => '结单时间',
  41. 'finished_images'=>'完结服务拍照',
  42. 'work_images'=>'工作拍照',
  43. 'code' => '工单验证码',
  44. 'remark' => '备注',
  45. ];
  46. /**
  47. * 领取场景
  48. * @return ServiceWorkValidate
  49. */
  50. public function sceneDetail()
  51. {
  52. return $this->only(['*']);
  53. }
  54. /**
  55. * 确认上门场景
  56. * @return ServiceWorkValidate
  57. */
  58. public function sceneDoor()
  59. {
  60. return $this->only(['work_sn','work_images']);
  61. }
  62. public function sceneFinished()
  63. {
  64. return $this->only(['work_sn','finished_images','code']);
  65. }
  66. public function sceneAgainDoor()
  67. {
  68. return $this->only(['work_sn','appointment_time']);
  69. }
  70. public function sceneRemark()
  71. {
  72. return $this->only(['work_sn','remark']);
  73. }
  74. }