diff --git a/app/common/repositories/store/order/StoreOrderCreateRepository.php b/app/common/repositories/store/order/StoreOrderCreateRepository.php index 107ad6b..ebc440b 100644 --- a/app/common/repositories/store/order/StoreOrderCreateRepository.php +++ b/app/common/repositories/store/order/StoreOrderCreateRepository.php @@ -82,6 +82,12 @@ class StoreOrderCreateRepository extends StoreOrderRepository{ //检查商品类型, 活动商品只能单独购买 foreach($merchantCartList as $merchantCart){ foreach($merchantCart['list'] as $cart){ + // 判断:是否按照批量购买 批量购买修改购买数量 + if($cart['is_batch'] == 1){ + $batch_num = $cart['batch_num'] ?? 1; + $cart['cart_num'] = (float)sprintf("%.2f", $batch_num * $cart['cart_num']); + } + 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).'...'); if($cart['product']['pay_limit'] == 1 && $cart['product']['once_max_count'] < $cart['cart_num']) throw new ValidateException('[超出单次限购数:'.$cart['product']['once_max_count'].']'.mb_substr($cart['product']['store_name'],0,10).'...');