This commit is contained in:
mkm 2024-01-23 12:29:22 +08:00
parent fa7e054bee
commit 78e013a1fe

View File

@ -85,16 +85,6 @@ class StoreOrderCreateRepository extends StoreOrderRepository
}
}
foreach ($merchantCart['list'] as $cart) {
$canBuy = (new StoreActivityDao())->canBuy($cart['uid'], $cart['product_id']);
if (!$canBuy) {
throw new ValidateException('活动商品限购1个');
}
if ($canBuy == 2) {
$activityProductCount += $cart['cart_num'];
if ($activityProductCount > 1){
throw new ValidateException('活动商品限购1个');
}
}
if ($cart['product_type'] == 0) {
if ($cart['product']['once_min_count'] > 0 && $cart['product']['once_min_count'] > $cart['cart_num'])
throw new ValidateException('[低于起购数:' . $cart['product']['once_min_count'] . ']' . mb_substr($cart['product']['store_name'], 0, 10) . '...');
@ -112,6 +102,18 @@ class StoreOrderCreateRepository extends StoreOrderRepository
$order_type = $cart['product_type'];
}
$source = $cart['source'];
if($source==103){
$canBuy = (new StoreActivityDao())->canBuy($cart['uid'], $cart['product_id']);
if (!$canBuy) {
throw new ValidateException('活动商品限购1个');
}
if ($canBuy == 2) {
$activityProductCount += $cart['cart_num'];
if ($activityProductCount > 1){
throw new ValidateException('活动商品限购1个');
}
}
}
if ($cart['product_type'] <= 97 && $cart['product_type'] > 0 && (($cart['product_type'] != 10 && count($merchantCart['list']) != 1) || count($merchantCartList) != 1)) {
throw new ValidateException('活动商品必须单独购买');
}