Kaynağa Gözat

满减优化

shish 6 ay önce
ebeveyn
işleme
8edbc4226b
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      app-ghs/controllers/OrderController.php

+ 1 - 1
app-ghs/controllers/OrderController.php

@@ -1279,9 +1279,9 @@ class OrderController extends BaseController
                     $unitPrice = $currentProduct['price'] ?? 0;
                     if ($unitPrice > $reachNumDiscount) {
                         $newUnitPrice = bcsub($unitPrice, $reachNumDiscount, 2);
-                        $productList[$ptKey]['price'] = $newUnitPrice;
                         $calcPrice = bcmul($reachNumDiscount, $bigNum, 2);
                         if ($calcPrice > 0 && isset($post['modifyPrice']) && $post['modifyPrice'] > $calcPrice) {
+                            $productList[$ptKey]['price'] = $newUnitPrice;
                             //提交给后端的总金额也要减掉,否则会有问题
                             $post['modifyPrice'] = bcsub($post['modifyPrice'], $calcPrice, 2);
                             $post['reachDiscountPrice'] = bcadd($post['reachDiscountPrice'], $calcPrice, 2);