|
|
@@ -1156,6 +1156,8 @@ class ProductClass extends BaseClass
|
|
|
$addPriceMap = CustomClass::$levelAddPriceKeyMap;
|
|
|
|
|
|
$totalItemNum = 0;
|
|
|
+ //满减累计
|
|
|
+ $totalReachDiscount = 0;
|
|
|
|
|
|
foreach ($itemInfo as $v) {
|
|
|
$ghsProductId = $v['productId'];
|
|
|
@@ -1176,8 +1178,18 @@ class ProductClass extends BaseClass
|
|
|
//供货商开单可以传单价过来
|
|
|
$changePrice = isset($v['price']) && $v['price'] > 0 ? $v['price'] : 0;
|
|
|
//今日特价、会员价
|
|
|
- $itemPrice = self::getFinalPrice($currentGhsProduct, $level, $priceMap, $addPriceMap, $changePrice);
|
|
|
+ $itemPrice = self::getFinalPrice($currentGhsProduct, $level, $priceMap, $addPriceMap, $changePrice, $itemNum);
|
|
|
$thisPrice = $itemPrice;
|
|
|
+
|
|
|
+ $reachNum = $currentGhsProduct['reachNum'] ?? 0;
|
|
|
+ if ($reachNum > 0) {
|
|
|
+ if ($itemNum >= $reachNum) {
|
|
|
+ $reachNumDiscount = $currentGhsProduct['reachNumDiscount'] ?? 0;
|
|
|
+ $currentReachDiscount = bcmul($reachNumDiscount, $itemNum, 2);
|
|
|
+ $totalReachDiscount = bcadd($totalReachDiscount, $currentReachDiscount, 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
$itemPrice = $v['unitPrice'] ?? 0;
|
|
|
$thisPrice = $itemPrice;
|
|
|
@@ -1253,7 +1265,7 @@ class ProductClass extends BaseClass
|
|
|
$data[] = $tmp;
|
|
|
}
|
|
|
|
|
|
- return ['product' => $data, 'smallNum' => $totalSmallNum, 'bigNum' => $totalBigNum, 'price' => $totalPrice, 'totalItemNum' => $totalItemNum];
|
|
|
+ return ['product' => $data, 'totalReachDiscount' => $totalReachDiscount, 'smallNum' => $totalSmallNum, 'bigNum' => $totalBigNum, 'price' => $totalPrice, 'totalItemNum' => $totalItemNum];
|
|
|
}
|
|
|
|
|
|
// //修改某个花材的成本价(采购之后要用到) lqh 2021.04.06
|