Browse Source

各跑腿平台的询价请求中的重量(weight)都使用 1 公斤

shizhongqi 9 months ago
parent
commit
4d1d8eaf80
1 changed files with 9 additions and 6 deletions
  1. 9 6
      common/components/delivery/util/DeliveryQuoteUtil.php

+ 9 - 6
common/components/delivery/util/DeliveryQuoteUtil.php

@@ -136,12 +136,15 @@ class DeliveryQuoteUtil
     private static function calculateTotalWeight($productList)
     {
         $weight = 0;
-        foreach ($productList as $itemData) {
-            $bigNum = $itemData['bigNum'] ?? 0;
-            $thisWeight = $itemData['weight'] ?? 0;
-            $currentWeight = bcmul($thisWeight, $bigNum, 2);
-            $weight = bcadd($currentWeight, $weight, 2);
-        }
+//        foreach ($productList as $itemData) {
+//            $bigNum = $itemData['bigNum'] ?? 0;
+//            $thisWeight = $itemData['weight'] ?? 0;
+//            $currentWeight = bcmul($thisWeight, $bigNum, 2);
+//            $weight = bcadd($currentWeight, $weight, 2);
+//        }
+        // TODO 先默认都是 1 公斤
+        $weight = 1;
+
         return $weight;
     }