|
|
@@ -424,23 +424,8 @@ class ProductClass extends BaseClass
|
|
|
}
|
|
|
if (isset($v['discountPrice']) && $v['discountPrice'] > 0) {
|
|
|
//做特价花材时,花材列表和改价列表显示的会员价和零售价,不能删除
|
|
|
- $addPrice = $v['addPrice'] ?? 0;
|
|
|
- $hjAddPrice = $v['hjAddPrice'] ?? 0;
|
|
|
- $diff = bcsub($addPrice, $hjAddPrice, 2);
|
|
|
- if ($diff > 0 && $v['discountPrice'] > $diff) {
|
|
|
- $hjPrice = bcsub($v['discountPrice'], $diff, 2);
|
|
|
- } else {
|
|
|
- $hjPrice = $v['discountPrice'];
|
|
|
- }
|
|
|
- $list[$k]['hjPrice'] = floatval($hjPrice);
|
|
|
- $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]['hjPrice'] = floatval($v['hjDiscountPrice']);
|
|
|
+ $list[$k]['skPrice'] = floatval($v['skDiscountPrice']);
|
|
|
}
|
|
|
$list[$k]['price'] = $price;
|
|
|
|
|
|
@@ -664,35 +649,18 @@ class ProductClass extends BaseClass
|
|
|
}
|
|
|
$currentPriceField = $priceMap[$level] ?? 'price';
|
|
|
$price = $product[$currentPriceField] ?? 0;
|
|
|
- //今日特价
|
|
|
$discountPrice = $product['discountPrice'] ?? 0;
|
|
|
+ $hjDiscountPrice = $product['hjDiscountPrice'] ?? 0;
|
|
|
+ $skDiscountPrice = $product['skDiscountPrice'] ?? 0;
|
|
|
if ($discountPrice > 0) {
|
|
|
if ($level == 0) {
|
|
|
- $skMore = $product['skMore'] ?? 0;
|
|
|
- $addPrice = $product['addPrice'] ?? 0;
|
|
|
- $diff = bcsub($skMore, $addPrice, 2);
|
|
|
- if ($diff > 0) {
|
|
|
- $price = bcadd($discountPrice, $diff, 2);
|
|
|
- } else {
|
|
|
- $price = $discountPrice;
|
|
|
- }
|
|
|
+ $price = $skDiscountPrice;
|
|
|
}
|
|
|
if ($level == 1) {
|
|
|
$price = $discountPrice;
|
|
|
}
|
|
|
if ($level == 2) {
|
|
|
- $hjAddPrice = $product['hjAddPrice'] ?? 0;
|
|
|
- $addPrice = $product['addPrice'] ?? 0;
|
|
|
- $diff = bcsub($addPrice, $hjAddPrice, 2);
|
|
|
- if ($diff > 0) {
|
|
|
- if ($discountPrice > $diff) {
|
|
|
- $price = bcsub($discountPrice, $diff, 2);
|
|
|
- } else {
|
|
|
- $price = $discountPrice;
|
|
|
- }
|
|
|
- } else {
|
|
|
- $price = $discountPrice;
|
|
|
- }
|
|
|
+ $price = $hjDiscountPrice;
|
|
|
}
|
|
|
}
|
|
|
return $price;
|