Merge pull request '调整商品限购' (#134) from fix into master

Reviewed-on: #134
This commit is contained in:
mkm 2024-01-23 17:56:31 +08:00
commit dd61153132

View File

@ -102,17 +102,15 @@ 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['is_true']==false) {
$canBuy = (new StoreActivityDao())->canBuy($cart['uid'], $cart['product_id']);
if ($canBuy['is_true']==false) {
throw new ValidateException('活动商品限购1个');
}
if ($canBuy['activityId']== 2) {
$activityProductCount += $cart['cart_num'];
if ($activityProductCount > 1){
throw new ValidateException('活动商品限购1个');
}
if ($canBuy['activityId']== 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('活动商品必须单独购买');