WIN-2308041133\Administrator 1 month ago
parent
commit
13fd50de98
1 changed files with 6 additions and 2 deletions
  1. 6 2
      app/models/store/StoreOrder.php

+ 6 - 2
app/models/store/StoreOrder.php

@@ -318,7 +318,7 @@ class StoreOrder extends BaseModel
             $mer_id = [];
             $mer_id = [];
             $totalNum = 0;
             $totalNum = 0;
             $gainIntegral = 0;
             $gainIntegral = 0;
-            $is_wholesale=0;
+            $is_wholesale=-1;
             foreach ($cartInfo as $cart) {
             foreach ($cartInfo as $cart) {
                 $cartIds[] = $cart['id'];
                 $cartIds[] = $cart['id'];
                 $totalNum += $cart['cart_num'];
                 $totalNum += $cart['cart_num'];
@@ -328,7 +328,11 @@ class StoreOrder extends BaseModel
                 if (!$combinationId) $combinationId = $cart['combination_id'];
                 if (!$combinationId) $combinationId = $cart['combination_id'];
                 $cartInfoGainIntegral = isset($cart['productInfo']['give_integral']) ? bcmul($cart['cart_num'], $cart['productInfo']['give_integral'], 2) : 0;
                 $cartInfoGainIntegral = isset($cart['productInfo']['give_integral']) ? bcmul($cart['cart_num'], $cart['productInfo']['give_integral'], 2) : 0;
                 $gainIntegral = bcadd($gainIntegral, $cartInfoGainIntegral, 2);
                 $gainIntegral = bcadd($gainIntegral, $cartInfoGainIntegral, 2);
-                var_dump($cart);die();
+                var_dump(json_encode($cart));die();
+                $is_wholesale = $cart['is_wholesale'];
+                if ($is_wholesale!=-1&&$is_wholesale!=$cart['is_wholesale']){
+                    return self::setErrorInfo('批发商品和普通商品不能混合购买!', true);
+                }
             }
             }
             $deduction = $seckill_id || $bargain_id || $combinationId;
             $deduction = $seckill_id || $bargain_id || $combinationId;
             if ($deduction) {
             if ($deduction) {