ServiceWorkValidate.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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',
  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' => '手机号',
  54. 'address' => '客户地址',
  55. 'title' => '工单名称',
  56. 'category_type' => '服务类别',
  57. 'goods_category_ids' => '服务类目',
  58. 'goods_category_id' => '服务产品',
  59. 'base_service_fee' => '基础服务费',
  60. 'service_fee' => '服务费用',
  61. 'work_status' => '工单状态',
  62. 'service_status' => '订单服务状态',
  63. 'dispatch_time' => '派单时间',
  64. 'receive_time' => '领单时间',
  65. 'appointment_time' => '预约上门时间',
  66. 'finished_time' => '结单时间',
  67. 'master_worker_id' => '师傅',
  68. ];
  69. /**
  70. * @notes 添加场景
  71. * @return ServiceWorkValidate
  72. * @author likeadmin
  73. * @date 2024/07/10 15:06
  74. */
  75. public function sceneAdd()
  76. {
  77. 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']);
  78. }
  79. /**
  80. * @notes 编辑场景
  81. * @return ServiceWorkValidate
  82. * @author likeadmin
  83. * @date 2024/07/10 15:06
  84. */
  85. public function sceneEdit()
  86. {
  87. return $this->only(['id','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']);
  88. }
  89. /**
  90. * @notes 删除场景
  91. * @return ServiceWorkValidate
  92. * @author likeadmin
  93. * @date 2024/07/10 15:06
  94. */
  95. public function sceneDelete()
  96. {
  97. return $this->only(['id']);
  98. }
  99. /**
  100. * @notes 详情场景
  101. * @return ServiceWorkValidate
  102. * @author likeadmin
  103. * @date 2024/07/10 15:06
  104. */
  105. public function sceneDetail()
  106. {
  107. return $this->only(['id']);
  108. }
  109. }