ServiceOrderValidate.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 sceneDetail()
  37. {
  38. return $this->only(['sn']);
  39. }
  40. public function sceneWorker()
  41. {
  42. return $this->only(['sn']);
  43. }
  44. public function sceneCancel()
  45. {
  46. return $this->only(['sn']);
  47. }
  48. public function scenePrice()
  49. {
  50. return $this->only(['sn']);
  51. }
  52. public function sceneFinished()
  53. {
  54. return $this->only(['sn']);
  55. }
  56. public function sceneQueryEffective()
  57. {
  58. return $this->only(['sn']);
  59. }
  60. public function sceneReceiveEffective()
  61. {
  62. return $this->only(['sn','goods_id']);
  63. }
  64. public function sceneFirmOrderSave()
  65. {
  66. return $this->only(['address','appointment_time','pay_way','contact_number','contact_people']);
  67. }
  68. }