|
@@ -2566,6 +2566,15 @@ HTML;
|
|
|
$hasGift = 1;
|
|
$hasGift = 1;
|
|
|
$gift_price = bcmul($item['cart_num'],$item['productInfo']['price'],2);
|
|
$gift_price = bcmul($item['cart_num'],$item['productInfo']['price'],2);
|
|
|
$price = bcadd($price,$gift_price,2);
|
|
$price = bcadd($price,$gift_price,2);
|
|
|
|
|
+ // 礼包商品只能购买一次检查
|
|
|
|
|
+ /** @var StoreOrderCartInfoServices $cartInfoServices */
|
|
|
|
|
+ $cartInfoServices = app()->make(StoreOrderCartInfoServices::class);
|
|
|
|
|
+ // 直接查询用户是否购买过该礼包商品的已支付订单
|
|
|
|
|
+
|
|
|
|
|
+ if ($cartInfoServices->hasUserPurchasedProduct($uid,$item['productInfo'] ['id'])) {
|
|
|
|
|
+ return app('json')->fail('礼包商品只能购买一次');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
if (isset($item['productInfo']['is_repeat']) && $item['productInfo']['is_repeat'] == 1) {
|
|
if (isset($item['productInfo']['is_repeat']) && $item['productInfo']['is_repeat'] == 1) {
|
|
|
$hasRepeat = 1;
|
|
$hasRepeat = 1;
|
|
@@ -2576,6 +2585,7 @@ HTML;
|
|
|
$arr[] = $item['productInfo']['logistics'];
|
|
$arr[] = $item['productInfo']['logistics'];
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
if ($price<200&&$hasGift==1){
|
|
if ($price<200&&$hasGift==1){
|
|
|
throw new ApiException('礼包商品订单金额不能小于200元');
|
|
throw new ApiException('礼包商品订单金额不能小于200元');
|
|
|
}
|
|
}
|