林琦海 5 лет назад
Родитель
Сommit
e654acf53e
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      common/components/freight.php

+ 2 - 2
common/components/freight.php

@@ -46,7 +46,7 @@ class freight
         //距离计算
         Yii::info("距离为:".$phpStatDistance);
         $phpStatDistance = $phpStatDistance -2;
-        if($phpStatDistance){
+        if($phpStatDistance > 0){
             if ($phpStatDistance <=10){
                 //每新增1km加2
                 $diffCost = $phpStatDistance*2;
@@ -66,7 +66,7 @@ class freight
         //重量计算
         Yii::info("重量为:".$weight);
         $weight = $weight -2;
-        if($weight){
+        if($weight > 0){
             if ($weight <=10){
                 //每增1 kg 加2
                 $diff = ceil(($weight - 2));