ServiceWorkValidate.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. * ServiceWork验证器
  18. * Class ServiceWorkValidate
  19. * @package app\adminapi\validate\works
  20. */
  21. class ServiceWorkValidate extends BaseValidate
  22. {
  23. /**
  24. * 设置校验规则
  25. * @var string[]
  26. */
  27. protected $rule = [
  28. 'id' => 'require',
  29. 'work_sn' => 'require',
  30. 'mobile' => 'require|mobile',
  31. 'address' => 'require',
  32. 'title' => 'require',
  33. 'category_type' => 'require',
  34. 'goods_category_ids' => 'require',
  35. 'goods_category_id' => 'require',
  36. 'base_service_fee' => 'require',
  37. 'service_fee' => 'require',
  38. 'work_status' => 'require',
  39. 'service_status' => 'require',
  40. 'dispatch_time' => 'require',
  41. 'receive_time' => 'require',
  42. 'appointment_time' => 'require',
  43. 'finished_time' => 'require',
  44. 'master_worker_id' => 'require',
  45. ];
  46. /**
  47. * 参数描述
  48. * @var string[]
  49. */
  50. protected $field = [
  51. 'id' => 'id',
  52. 'work_sn' => '工单编号',
  53. 'mobile.require' => '手机号',
  54. 'mobile.mobile' => '手机号错误',
  55. 'address' => '客户地址',
  56. 'title' => '工单名称',
  57. 'category_type' => '服务类别',
  58. 'goods_category_ids' => '服务类目',
  59. 'goods_category_id' => '服务产品',
  60. 'base_service_fee' => '基础服务费',
  61. 'service_fee' => '服务费用',
  62. 'work_status' => '工单状态',
  63. 'service_status' => '订单服务状态',
  64. 'dispatch_time' => '派单时间',
  65. 'receive_time' => '领单时间',
  66. 'appointment_time' => '预约上门时间',
  67. 'finished_time' => '结单时间',
  68. 'master_worker_id' => '工程师',
  69. ];
  70. /**
  71. * @notes 添加场景
  72. * @return ServiceWorkValidate
  73. * @author likeadmin
  74. * @date 2024/07/10 15:06
  75. */
  76. public function sceneAdd()
  77. {
  78. return $this->only(['work_sn','mobile','address','title','category_type','goods_category_ids','goods_category_id','base_service_fee','service_fee','work_status','service_status','dispatch_time','receive_time','appointment_time','finished_time','master_worker_id']);
  79. }
  80. /**
  81. * @notes 编辑场景
  82. * @return ServiceWorkValidate
  83. * @author likeadmin
  84. * @date 2024/07/10 15:06
  85. */
  86. public function sceneEdit()
  87. {
  88. return $this->only(['id','mobile','address','appointment_time']);
  89. }
  90. /**
  91. * @notes 删除场景
  92. * @return ServiceWorkValidate
  93. * @author likeadmin
  94. * @date 2024/07/10 15:06
  95. */
  96. public function sceneDelete()
  97. {
  98. return $this->only(['id']);
  99. }
  100. /**
  101. * @notes 详情场景
  102. * @return ServiceWorkValidate
  103. * @author likeadmin
  104. * @date 2024/07/10 15:06
  105. */
  106. public function sceneDetail()
  107. {
  108. return $this->only(['id']);
  109. }
  110. /**
  111. * 分配工程师场景
  112. * @return ServiceWorkValidate
  113. * @author 林海涛
  114. * @date 2024/7/16 下午4:38
  115. */
  116. public function sceneAllocateWorker()
  117. {
  118. return $this->only(['id','master_worker_id']);
  119. }
  120. }