Explorar o código

运费计算优化

林琦海 %!s(int64=5) %!d(string=hai) anos
pai
achega
cf7873fb85
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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{