瀏覽代碼

运费计算优化

林琦海 5 年之前
父節點
當前提交
cf7873fb85
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      common/components/freight.php

+ 2 - 2
common/components/freight.php

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