Cart.php 770 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2017 https://www.sapixx.com All rights reserved.
  4. * @license Licensed (http://www.apache.org/licenses/LICENSE-2.0).
  5. * @author pillar<ltmn@qq.com>
  6. * 提交订单和购物车
  7. */
  8. namespace app\fastshop\validate;
  9. use think\Validate;
  10. class Cart extends Validate{
  11. protected $rule = [
  12. 'address' => 'require|integer|>:0',
  13. 'cart' => 'require|integer|>:0',
  14. 'ids' => 'require',
  15. ];
  16. protected $message = [
  17. 'address' => '收货地址必须填写',
  18. 'cart' => '提交商品不能为空',
  19. 'ids' => '提交商品不能为空',
  20. ];
  21. protected $scene = [
  22. 'add_order' => ['address','ids'],
  23. 'sale_order' => ['address','cart'],
  24. ];
  25. }