Kaynağa Gözat

红包 不同的人卖不同的价格四舍五入

shish 4 yıl önce
ebeveyn
işleme
7707210131

+ 3 - 1
biz-ghs/product/classes/ProductClass.php

@@ -131,7 +131,7 @@ class ProductClass extends BaseClass
             $customDiscount = isset(Yii::$app->params['customDiscount']) ? Yii::$app->params['customDiscount'] : 1;
             if ($customDiscount < 1 && $customDiscount > 0) {
                 $price = bcmul($price, $customDiscount, 2);
-                //四舍五入保留整数
+                //四舍五入保留整数,涉及多个地方要同步修改,请搜索关键词:round_price!!!!
                 $price = round($price, 0);
             }
 
@@ -619,6 +619,8 @@ class ProductClass extends BaseClass
             //不同的人卖不同价格
             if ($discount > 0 && $discount < 1) {
                 $itemPrice = bcmul($itemPrice, $discount, 2);
+                //四舍五入保留整数,涉及多个地方要同步修改,请搜索关键词:round_price!!!!
+                $itemPrice = round($itemPrice, 0);
             }
 
             //供应商开单可以传单价过来

+ 2 - 0
biz-hd/purchase/classes/PurchaseClass.php

@@ -105,6 +105,8 @@ class PurchaseClass extends BaseClass
 
             if ($giveDiscount < 1 && $giveDiscount > 0) {
                 $price = bcmul($price, $giveDiscount, 2);
+                //四舍五入保留整数,涉及多个地方要同步修改,请搜索关键词:round_price!!!!
+                $price = round($price, 0);
             }
 
             //花材原价