|
|
@@ -371,10 +371,13 @@ class PurchaseClass extends BaseClass
|
|
|
$bigPrice = $price;
|
|
|
|
|
|
if ($currentSmallNum > 0) {
|
|
|
- $ghsRatio = $currentProduct['ratio'] ?? 0;
|
|
|
- $ghsSmallRatio = $currentProduct['smallRatio'] ?? 1;
|
|
|
- $price = bcdiv($price, $ghsRatio, 2);
|
|
|
- $price = bcmul($price, $ghsSmallRatio, 2);
|
|
|
+ //如果是小单位数量,则传过来的就是小单位价格,无需转换
|
|
|
+ if (empty($changePrice)) {
|
|
|
+ $ghsRatio = $currentProduct['ratio'] ?? 0;
|
|
|
+ $ghsSmallRatio = $currentProduct['smallRatio'] ?? 1;
|
|
|
+ $price = bcdiv($price, $ghsRatio, 2);
|
|
|
+ $price = bcmul($price, $ghsSmallRatio, 2);
|
|
|
+ }
|
|
|
$productTotalPrice = bcmul($currentSmallNum, $price, 2);
|
|
|
} else {
|
|
|
$productTotalPrice = bcmul($currentBigNum, $price, 2);
|