ServiceOrderValidate.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. namespace app\api\validate;
  3. use app\common\enum\PayEnum;
  4. use app\common\service\ConfigService;
  5. use app\common\validate\BaseValidate;
  6. /**
  7. * 服务订单验证器
  8. * Class ServiceOrderValidate
  9. * @package app\api\validate
  10. */
  11. class ServiceOrderValidate extends BaseValidate
  12. {
  13. protected $rule = [
  14. 'order_id'=>'require',
  15. 'sn'=>'require',
  16. 'address' => 'require',
  17. 'appointment_time' => 'require|dateFormat:Y-m-d H:i:s',
  18. 'pay_way' => 'require',
  19. 'goods_id' => 'require',
  20. 'contact_number' => 'require',
  21. 'contact_people' => 'require'
  22. ];
  23. protected $message = [
  24. 'order_id.require' => '订单ID错误',
  25. 'sn.require' => '订单编号错误',
  26. 'address.require' => '请填写地址',
  27. 'appointment_time.require' => '请填写预约上门时间',
  28. 'appointment_time.dateFormat' => '预约上门时间格式错误',
  29. 'pay_way.require' => '请选择支付方式',
  30. 'goods_id.require' => '订单商品不存在',
  31. 'contact_number.require' => '联系电话不存在',
  32. 'contact_people.require' => '联系人不存在',
  33. ];
  34. public function sceneAdd()
  35. {
  36. return $this->only(['address','appointment_time','pay_way','goods_id','contact_number','contact_people']);
  37. }
  38. public function sceneFinal()
  39. {
  40. return $this->only(['sn']);
  41. }
  42. public function sceneDetail()
  43. {
  44. return $this->only(['sn']);
  45. }
  46. public function sceneWorker()
  47. {
  48. return $this->only(['sn']);
  49. }
  50. public function sceneCancel()
  51. {
  52. return $this->only(['sn']);
  53. }
  54. public function scenePrice()
  55. {
  56. return $this->only(['sn']);
  57. }
  58. public function sceneFinished()
  59. {
  60. return $this->only(['sn']);
  61. }
  62. public function sceneQueryEffective()
  63. {
  64. return $this->only(['sn']);
  65. }
  66. public function sceneReceiveEffective()
  67. {
  68. return $this->only(['sn','goods_id']);
  69. }
  70. public function sceneFirmOrderSave()
  71. {
  72. return $this->only(['address','appointment_time','pay_way','contact_number','contact_people']);
  73. }
  74. public function sceneCancelOrderCoupon()
  75. {
  76. return $this->only(['sn']);
  77. }
  78. }