StoreOrderValidate.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\validate\admin\order;
  12. use think\Validate;
  13. /**
  14. *
  15. * Class StoreOrderValidate
  16. * @package app\validates\admin
  17. */
  18. class StoreOrderValidate extends Validate
  19. {
  20. protected $rule = [
  21. 'order_id' => ['require','length'=>'1,32','alphaNum'],
  22. 'total_price' => ['require','float'],
  23. 'total_postage' => ['require','float'],
  24. 'pay_price' => ['require','float'],
  25. 'pay_postage' => ['require','float'],
  26. 'gain_integral' => ['float'],
  27. ];
  28. protected $message = [
  29. 'order_id.require' => '订单号必须存在',
  30. 'order_id.length' => '订单号有误',
  31. 'order_id.alphaNum' => '订单号必须为字母和数字',
  32. 'total_price.require' => '订单金额必须填写',
  33. 'total_price.float' => '订单金额必须为数字',
  34. 'pay_price.require' => '订单金额必须填写',
  35. 'pay_price.float' => '订单金额必须为数字',
  36. 'pay_postage.require' => '订单邮费必须填写',
  37. 'pay_postage.float' => '订单邮费必须为数字',
  38. 'gain_integral.float' => '赠送积分必须为数字',
  39. ];
  40. protected $scene = [
  41. ];
  42. }