ServiceOrderValidate.php 941 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. 'address' => 'require',
  15. 'appointment_time' => 'require|dateFormat:Y-m-d H:i:s',
  16. 'pay_way' => 'require',
  17. 'goods_id' => 'require',
  18. ];
  19. protected $message = [
  20. 'address.require' => '请填写地址',
  21. 'appointment_time.require' => '请填写预约上门时间',
  22. 'appointment_time.dateFormat' => '预约上门时间格式错误',
  23. 'pay_way.require' => '请选择支付方式',
  24. 'goods_id.require' => '订单商品不存在',
  25. ];
  26. public function sceneAdd()
  27. {
  28. return $this->only(['address','appointment_time','pay_way','goods_id']);
  29. }
  30. }