ServiceOrderValidate.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. 'lon' => 'require',
  23. 'lat' => 'require',
  24. ];
  25. protected $message = [
  26. 'order_id.require' => '订单ID错误',
  27. 'sn.require' => '订单编号错误',
  28. 'address.require' => '请填写地址',
  29. 'appointment_time.require' => '请填写预约上门时间',
  30. 'appointment_time.dateFormat' => '预约上门时间格式错误',
  31. 'pay_way.require' => '请选择支付方式',
  32. 'goods_id.require' => '订单商品不存在',
  33. 'contact_number.require' => '联系电话不存在',
  34. 'contact_people.require' => '联系人不存在',
  35. 'lon.require' => '经度不存在',
  36. 'lat.require' => '纬度不存在',
  37. ];
  38. public function sceneAdd()
  39. {
  40. return $this->only(['address','appointment_time','pay_way','goods_id','contact_number','contact_people']);
  41. }
  42. public function sceneFinal()
  43. {
  44. return $this->only(['sn']);
  45. }
  46. public function sceneDetail()
  47. {
  48. return $this->only(['sn']);
  49. }
  50. public function sceneWorker()
  51. {
  52. return $this->only(['sn']);
  53. }
  54. public function sceneCancel()
  55. {
  56. return $this->only(['sn']);
  57. }
  58. public function scenePrice()
  59. {
  60. return $this->only(['sn']);
  61. }
  62. public function sceneFinished()
  63. {
  64. return $this->only(['sn']);
  65. }
  66. public function sceneQueryEffective()
  67. {
  68. return $this->only(['sn']);
  69. }
  70. public function sceneReceiveEffective()
  71. {
  72. return $this->only(['sn','goods_id']);
  73. }
  74. public function sceneFirmOrderSave()
  75. {
  76. return $this->only(['address','appointment_time','pay_way','contact_number','contact_people']);
  77. }
  78. public function sceneCancelOrderCoupon()
  79. {
  80. return $this->only(['sn']);
  81. }
  82. public function sceneLonLat()
  83. {
  84. return $this->only(['lon','lat']);
  85. }
  86. public function sceneChangePrice()
  87. {
  88. return $this->only(['sn']);
  89. }
  90. public function sceneChangeAppointment()
  91. {
  92. return $this->only(['sn','appointment_time']);
  93. }
  94. }