GroupServiceWorkValidate.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\adminapi\validate\works;
  15. use app\common\validate\BaseValidate;
  16. /**
  17. * GroupServiceWork验证器
  18. * Class GroupServiceWorkValidate
  19. * @package app\adminapi\validate\works
  20. */
  21. class GroupServiceWorkValidate extends BaseValidate
  22. {
  23. /**
  24. * 设置校验规则
  25. * @var string[]
  26. */
  27. protected $rule = [
  28. 'id' => 'require',
  29. 'work_sn' => 'require',
  30. 'mobile' => 'require',
  31. 'address' => 'require',
  32. 'title' => 'require',
  33. 'category_type' => 'require',
  34. 'goods_category_ids' => 'require',
  35. 'goods_category_id' => 'require',
  36. 'work_status' => 'require',
  37. 'service_status' => 'require',
  38. 'dispatch_time' => 'require',
  39. 'receive_time' => 'require',
  40. 'appointment_time' => 'require',
  41. 'finished_time' => 'require',
  42. 'master_worker_id' => 'require',
  43. ];
  44. /**
  45. * 参数描述
  46. * @var string[]
  47. */
  48. protected $field = [
  49. 'id' => 'id',
  50. 'work_sn' => '工单编号',
  51. 'mobile' => '手机号',
  52. 'address' => '客户地址',
  53. 'title' => '工单名称',
  54. 'category_type' => '服务类别',
  55. 'goods_category_ids' => '服务类目',
  56. 'goods_category_id' => '服务产品',
  57. 'base_service_fee' => '基础服务费',
  58. 'service_fee' => '服务费用',
  59. 'work_status' => '工单状态',
  60. 'service_status' => '订单服务状态',
  61. 'dispatch_time' => '派单时间',
  62. 'receive_time' => '领单时间',
  63. 'appointment_time' => '预约上门时间',
  64. 'finished_time' => '结单时间',
  65. 'master_worker_id' => '工程师',
  66. ];
  67. /**
  68. * @notes 添加场景
  69. * @return ServiceWorkValidate
  70. * @author likeadmin
  71. * @date 2024/07/10 15:06
  72. */
  73. public function sceneAdd()
  74. {
  75. return $this->only(['work_sn','mobile','address','title','category_type','goods_category_ids','goods_category_id','work_status','service_status','dispatch_time','receive_time','appointment_time','finished_time','master_worker_id']);
  76. }
  77. /**
  78. * @notes 编辑场景
  79. * @return ServiceWorkValidate
  80. * @author likeadmin
  81. * @date 2024/07/10 15:06
  82. */
  83. public function sceneEdit()
  84. {
  85. return $this->only(['id','address','appointment_time']);
  86. }
  87. /**
  88. * @notes 删除场景
  89. * @return ServiceWorkValidate
  90. * @author likeadmin
  91. * @date 2024/07/10 15:06
  92. */
  93. public function sceneDelete()
  94. {
  95. return $this->only(['id']);
  96. }
  97. /**
  98. * @notes 详情场景
  99. * @return ServiceWorkValidate
  100. * @author likeadmin
  101. * @date 2024/07/10 15:06
  102. */
  103. public function sceneDetail()
  104. {
  105. return $this->only(['id']);
  106. }
  107. /**
  108. * 分配工程师场景
  109. * @return ServiceWorkValidate
  110. * @author 林海涛
  111. * @date 2024/7/16 下午4:38
  112. */
  113. public function sceneAllocateWorker()
  114. {
  115. return $this->only(['id','master_worker_id']);
  116. }
  117. }