|
@@ -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;
|
|
|
|
|
|