shish před 5 dny
rodič
revize
bd7d279109

+ 1 - 3
app-ghs/controllers/OrderController.php

@@ -1624,12 +1624,10 @@ class OrderController extends BaseController
 
 
                 $limitBuy = $systemInfo['limitBuy'] ?? 0;
                 $limitBuy = $systemInfo['limitBuy'] ?? 0;
                 $bigNum = $currentProduct['bigNum'] ?? 0;
                 $bigNum = $currentProduct['bigNum'] ?? 0;
-                if ($limitBuy == 1) {
+                if ($limitBuy > 0) {
                     if ($bigNum > 0) {
                     if ($bigNum > 0) {
-
                         $addPriceMap['couldDiscount'] = 0;
                         $addPriceMap['couldDiscount'] = 0;
                         $orgPrice = ProductClass::getFinalPrice($systemInfo, $level, $priceMap, $addPriceMap);
                         $orgPrice = ProductClass::getFinalPrice($systemInfo, $level, $priceMap, $addPriceMap);
-
                         //限购在这里开发,关键词 xg_develop
                         //限购在这里开发,关键词 xg_develop
                         $productList[$ptKey]['price'] = $orgPrice;
                         $productList[$ptKey]['price'] = $orgPrice;
                         if ($currentPrice > $orgPrice) {
                         if ($currentPrice > $orgPrice) {

+ 11 - 6
biz-ghs/product/classes/ProductClass.php

@@ -366,6 +366,7 @@ class ProductClass extends BaseClass
             $list[$k]['smallNum'] = $stockInfo['smallNum'];
             $list[$k]['smallNum'] = $stockInfo['smallNum'];
 
 
             $price = self::getFinalPrice($v, $level, $priceMap, $addPriceMap);
             $price = self::getFinalPrice($v, $level, $priceMap, $addPriceMap);
+            $list[$k]['originPrice'] = $list[$k]['price']; //原始价
             $list[$k]['price'] = $price;
             $list[$k]['price'] = $price;
             $list[$k]['bigPrice'] = $price;
             $list[$k]['bigPrice'] = $price;
             $smallRatio = $v['smallRatio'] ?? 0;
             $smallRatio = $v['smallRatio'] ?? 0;
@@ -803,14 +804,13 @@ class ProductClass extends BaseClass
             $currentPriceField = $priceMap[$level] ?? 'price';
             $currentPriceField = $priceMap[$level] ?? 'price';
             $price = $product[$currentPriceField] ?? 0;
             $price = $product[$currentPriceField] ?? 0;
         }
         }
-
         //特价与限购的综合处理
         //特价与限购的综合处理
         $discountPrice = $product['discountPrice'] ?? 0;
         $discountPrice = $product['discountPrice'] ?? 0;
         $hjDiscountPrice = $product['hjDiscountPrice'] ?? 0;
         $hjDiscountPrice = $product['hjDiscountPrice'] ?? 0;
         $skDiscountPrice = $product['skDiscountPrice'] ?? 0;
         $skDiscountPrice = $product['skDiscountPrice'] ?? 0;
         $limitBuy = $product['limitBuy'];
         $limitBuy = $product['limitBuy'];
         //后台开单,如果花材限购的,则不考虑特价,只取原价
         //后台开单,如果花材限购的,则不考虑特价,只取原价
-        $couldDiscount = $param['couldDiscount'] ?? 1;
+        $couldDiscount = $params['couldDiscount'] ?? 1;
         if($couldDiscount == 1){
         if($couldDiscount == 1){
             if ($discountPrice > 0) {
             if ($discountPrice > 0) {
                 $oldPrice = $price;
                 $oldPrice = $price;
@@ -1469,6 +1469,7 @@ class ProductClass extends BaseClass
         $book = $moreParams['book'] ?? 0;
         $book = $moreParams['book'] ?? 0;
         $customShopAdminId = $moreParams['customShopAdminId'] ?? 0;
         $customShopAdminId = $moreParams['customShopAdminId'] ?? 0;
         $custom = $moreParams['custom'] ?? [];
         $custom = $moreParams['custom'] ?? [];
+        $skipLimitBuy = $moreParams['skipLimitBuy'] ?? false;
         //不同等级对应 price addPrice
         //不同等级对应 price addPrice
         $priceMap = CustomClass::$levelPriceKeyMap;
         $priceMap = CustomClass::$levelPriceKeyMap;
         //这个参数应该是要作废的,但下面加的参数是有用的,多处要同步修改,关键词 abandon_add_price_map ,ssh 20260116
         //这个参数应该是要作废的,但下面加的参数是有用的,多处要同步修改,关键词 abandon_add_price_map ,ssh 20260116
@@ -1507,12 +1508,16 @@ class ProductClass extends BaseClass
                 if ($book == 1 && $customShopAdminId > 0) {
                 if ($book == 1 && $customShopAdminId > 0) {
                     $itemPrice = 0.1;
                     $itemPrice = 0.1;
                 } else {
                 } else {
-                    $limitKey = self::LIMIT_BUY_KEY . $ghsProductId;
-                    $hasBuyNum = Yii::$app->redis->executeCommand('HGET', [$limitKey, $custom['id']]);
-                    $hasBuyNum = $itemNum + ($hasBuyNum == null ? 0 : $hasBuyNum); // 已购买总数量
+                    $priceBuyNum = $skipLimitBuy ? 0 : $itemNum;
+                    $totalBuyNum = 0;
+                    if ($skipLimitBuy == false) {
+                        $limitKey = self::LIMIT_BUY_KEY . $ghsProductId;
+                        $hasBuyNum = Yii::$app->redis->executeCommand('HGET', [$limitKey, $custom['id']]);
+                        $totalBuyNum = $itemNum + ($hasBuyNum == null ? 0 : $hasBuyNum); // 已购买总数量
+                    }
 
 
                     //今日特价、会员价
                     //今日特价、会员价
-                    $itemPrice = self::getFinalPrice($currentGhsProduct, $level, $priceMap, $addPriceMap, $changePrice, $itemNum, $hasBuyNum);
+                    $itemPrice = self::getFinalPrice($currentGhsProduct, $level, $priceMap, $addPriceMap, $changePrice, $priceBuyNum, $totalBuyNum);
                 }
                 }
                 $thisPrice = $itemPrice;
                 $thisPrice = $itemPrice;