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