Order.php 852 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: zhengmingwei
  5. * Date: 2019/11/5
  6. * Time: 11:00 下午
  7. */
  8. namespace addons\unishop\validate;
  9. use think\Validate;
  10. class Order extends Validate
  11. {
  12. /**
  13. * 验证规则
  14. */
  15. protected $rule = [
  16. 'product_id' => 'require',
  17. 'number' => 'require',
  18. 'remark' => 'max:250',
  19. ];
  20. /**
  21. * 提示消息
  22. */
  23. protected $message = [
  24. 'product_id.required' => '产品编号不能为空',
  25. 'number.require' => '商品数量不能为空',
  26. 'remark.max' => '备注不能超过250个文字',
  27. ];
  28. /**
  29. * 验证场景
  30. */
  31. protected $scene = [
  32. 'submit' => ['product_id', 'number', 'remark'], // 创建订单
  33. 'submitFlash' => ['product_id', 'number', 'city_id', 'remark', 'flash_id'], // 秒杀创建订单
  34. ];
  35. }