|
|
@@ -49,7 +49,8 @@ class freight
|
|
|
if($phpStatDistance > 0){
|
|
|
if ($phpStatDistance <=10){
|
|
|
//每新增1km加2
|
|
|
- $diffCost = $phpStatDistance*2;
|
|
|
+ $phpStatDistanceCeil = ceil($phpStatDistance);
|
|
|
+ $diffCost = $phpStatDistanceCeil*2;
|
|
|
$cost += $diffCost;
|
|
|
}else{
|
|
|
//8*2
|
|
|
@@ -65,11 +66,13 @@ class freight
|
|
|
|
|
|
//重量计算
|
|
|
Yii::info("重量为:".$weight);
|
|
|
+ $weight = 5.5;
|
|
|
$weight = $weight -2;
|
|
|
if($weight > 0){
|
|
|
if ($weight <=10){
|
|
|
//每增1 kg 加2
|
|
|
- $diffCost = $weight*2;
|
|
|
+ $weightCeil = ceil($weight);
|
|
|
+ $diffCost = $weightCeil*2;
|
|
|
$cost += $diffCost;
|
|
|
$weight = $weight -2;
|
|
|
}else{
|