|
|
@@ -156,7 +156,6 @@ class ProductClass extends BaseClass
|
|
|
//各个等级对应的price addPrice字段
|
|
|
$priceMap = CustomClass::$levelPriceKeyMap;
|
|
|
$addPriceMap = CustomClass::$levelAddPriceKeyMap;
|
|
|
-
|
|
|
foreach ($list as $k => $v) {
|
|
|
$shortCover = $v['cover'] ?? '';
|
|
|
$cover = imgUtil::getPrefix() . 'hhb_small.png';
|
|
|
@@ -168,20 +167,16 @@ class ProductClass extends BaseClass
|
|
|
$cover = self::groupImg($shortCover);
|
|
|
}
|
|
|
}
|
|
|
+ $ratio = isset($v['ratio']) && $v['ratio'] > 0 ? $v['ratio'] : 1;
|
|
|
$list[$k]['cover'] = $cover;
|
|
|
//今日特价、会员价
|
|
|
$price = self::getFinalPrice($v, $level, $priceMap, $addPriceMap);
|
|
|
- //零售做特价时的原价
|
|
|
- if ($level == 0) {
|
|
|
- $currentAddPrice = $v['skMore'] ?? 0;
|
|
|
- $list[$k]['prePrice'] = bcadd($v['price'], $currentAddPrice, 2);
|
|
|
- }
|
|
|
- if (isset($v['discountPrice']) && $v['discountPrice'] > 0) {
|
|
|
- //改价列表显示的散客价【重要】
|
|
|
- $currentAddPrice = $v['skMore'] ?? 0;
|
|
|
- $list[$k]['skPrice'] = bcadd($v['discountPrice'], $currentAddPrice, 2);
|
|
|
- }
|
|
|
$list[$k]['price'] = $price;
|
|
|
+ $list[$k]['bigPrice'] = $price;
|
|
|
+ $smallRatio = $v['smallRatio'] ?? 0;
|
|
|
+ $smallPrice = bcdiv($price, $ratio, 2);
|
|
|
+ $smallPrice = bcmul($smallPrice, $smallRatio, 2);
|
|
|
+ $list[$k]['smallPrice'] = $smallPrice;
|
|
|
}
|
|
|
return $list;
|
|
|
}
|