ServiceOrderValidate.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. 'sn'=>'require',
  15. 'address' => 'require',
  16. 'appointment_time' => 'require|dateFormat:Y-m-d H:i:s',
  17. 'pay_way' => 'require',
  18. 'goods_id' => 'require',
  19. 'contact_number' => 'require',
  20. 'contact_people' => 'require'
  21. ];
  22. protected $message = [
  23. 'sn.require' => '订单编号错误',
  24. 'address.require' => '请填写地址',
  25. 'appointment_time.require' => '请填写预约上门时间',
  26. 'appointment_time.dateFormat' => '预约上门时间格式错误',
  27. 'pay_way.require' => '请选择支付方式',
  28. 'goods_id.require' => '订单商品不存在',
  29. 'contact_number.require' => '联系电话不存在',
  30. 'contact_people.require' => '联系人不存在',
  31. ];
  32. public function sceneAdd()
  33. {
  34. return $this->only(['address','appointment_time','pay_way','goods_id','contact_number','contact_people']);
  35. }
  36. public function sceneFinal()
  37. {
  38. return $this->only(['sn']);
  39. }
  40. public function sceneDetail()
  41. {
  42. return $this->only(['sn']);
  43. }
  44. public function sceneWorker()
  45. {
  46. return $this->only(['sn']);
  47. }
  48. public function sceneCancel()
  49. {
  50. return $this->only(['sn']);
  51. }
  52. public function scenePrice()
  53. {
  54. return $this->only(['sn']);
  55. }
  56. public function sceneFinished()
  57. {
  58. return $this->only(['sn']);
  59. }
  60. public function sceneQueryEffective()
  61. {
  62. return $this->only(['sn']);
  63. }
  64. public function sceneReceiveEffective()
  65. {
  66. return $this->only(['sn','goods_id']);
  67. }
  68. public function sceneFirmOrderSave()
  69. {
  70. return $this->only(['address','appointment_time','pay_way','contact_number','contact_people']);
  71. }
  72. }