|
@@ -159,25 +159,19 @@ class ProductClass extends BaseClass
|
|
|
if (empty($product) || isset($product['price']) == false) {
|
|
if (empty($product) || isset($product['price']) == false) {
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
- //今日特价
|
|
|
|
|
- $discountPrice = $product['discountPrice'] ?? 0;
|
|
|
|
|
-
|
|
|
|
|
$currentPriceField = $priceMap[$level] ?? 'price';
|
|
$currentPriceField = $priceMap[$level] ?? 'price';
|
|
|
$price = $product[$currentPriceField] ?? 0;
|
|
$price = $product[$currentPriceField] ?? 0;
|
|
|
- if ($discountPrice > 0) {
|
|
|
|
|
-
|
|
|
|
|
- $discountAddPrice = $product['addPrice'] ?? 0;
|
|
|
|
|
|
|
|
|
|
|
|
+ //今日特价
|
|
|
|
|
+ $discountPrice = $product['discountPrice'] ?? 0;
|
|
|
|
|
+ if ($discountPrice > 0) {
|
|
|
$currentAddPriceField = $addPriceMap[$level] ?? 'addPrice';
|
|
$currentAddPriceField = $addPriceMap[$level] ?? 'addPrice';
|
|
|
$currentAddPrice = $product[$currentAddPriceField] ?? 0;
|
|
$currentAddPrice = $product[$currentAddPriceField] ?? 0;
|
|
|
-
|
|
|
|
|
- $diff = bcsub($discountAddPrice, $currentAddPrice, 2);
|
|
|
|
|
- $price = bcsub($discountPrice, $diff, 2);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if ($currentAddPriceField == 'skMore') {
|
|
|
|
|
+ $price = bcadd($discountPrice, $currentAddPrice, 2);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
return $price;
|
|
return $price;
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//根据花材ID,库存=》 计算出多少扎,多少支
|
|
//根据花材ID,库存=》 计算出多少扎,多少支
|