shish пре 3 година
родитељ
комит
b83b174bcd
1 измењених фајлова са 6 додато и 2 уклоњено
  1. 6 2
      app-hd/controllers/PurchaseController.php

+ 6 - 2
app-hd/controllers/PurchaseController.php

@@ -257,7 +257,9 @@ class PurchaseController extends BaseController
                 //昆明发货包装费和运费的计算
                 $totalWeight = 0;
                 foreach ($productList as $itemData) {
-                    $currentWeight = $itemData['weight'] ?? 0;
+                    $bigNum = $itemData['bigNum'] ?? 0;
+                    $thisWeight = $itemData['weight'] ?? 0;
+                    $currentWeight = bcmul($thisWeight, $bigNum, 2);
                     $totalWeight = bcadd($currentWeight, $totalWeight, 2);
                 }
                 $kmPackCost = dict::getDict('kmPackCost');
@@ -305,7 +307,9 @@ class PurchaseController extends BaseController
                 if ($sendType == dict::getDict('sendType', 'thirdSend')) {
                     $weight = 0;
                     foreach ($productList as $itemData) {
-                        $currentWeight = $itemData['weight'] ?? 0;
+                        $bigNum = $itemData['bigNum'] ?? 0;
+                        $thisWeight = $itemData['weight'] ?? 0;
+                        $currentWeight = bcmul($thisWeight, $bigNum, 2);
                         $weight = bcadd($currentWeight, $weight, 2);
                     }
                     $result = PurchaseClass::getDistanceFee($this->shop, $ghsShopInfo, $weight);