Jelajahi Sumber

运费计算优化

林琦海 5 tahun lalu
induk
melakukan
cf7873fb85
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      common/components/freight.php

+ 2 - 2
common/components/freight.php

@@ -65,12 +65,12 @@ class freight
 
         //重量计算
         Yii::info("重量为:".$weight);
+        $weight = 5;
         $weight = $weight -2;
         if($weight > 0){
             if ($weight <=10){
                 //每增1 kg 加2
-                $diff = ceil(($weight - 2));
-                $diffCost = $diff*2;
+                $diffCost = $weight*2;
                 $cost += $diffCost;
                 $weight = $weight -2;
             }else{