|
|
@@ -534,14 +534,22 @@ class ProductClass extends BaseClass
|
|
|
|
|
|
//零售做特价时的原价
|
|
|
if ($level == 0) {
|
|
|
- $currentAddPrice = $v['skMore'] ?? 0;
|
|
|
- $list[$k]['prePrice'] = bcadd($v['price'], $currentAddPrice, 2);
|
|
|
+ //零售做特价时显示的原价,不能删除
|
|
|
+ if(isset($v['skPrice'])){
|
|
|
+ $list[$k]['prePrice'] = $v['skPrice'];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (isset($v['discountPrice']) && $v['discountPrice'] > 0) {
|
|
|
- //改价列表显示的零售价【重要】
|
|
|
- $currentAddPrice = $v['skMore'] ?? 0;
|
|
|
- $list[$k]['skPrice'] = bcadd($v['discountPrice'], $currentAddPrice, 2);
|
|
|
+ $addPrice = $v['addPrice'] ?? 0;
|
|
|
+ $skMore = $v['skMore'] ?? 0;
|
|
|
+ $diff = bcsub($skMore,$addPrice,2);
|
|
|
+ if($diff>0){
|
|
|
+ $skPrice = bcadd($v['discountPrice'],$diff,2);
|
|
|
+ }else{
|
|
|
+ $skPrice = $v['discountPrice'];
|
|
|
+ }
|
|
|
+ $list[$k]['skPrice'] = floatval($skPrice);
|
|
|
}
|
|
|
|
|
|
$list[$k]['price'] = $price;
|