xxxrrrdddd 2 年 前
コミット
6bb2ec7534
1 ファイル変更10 行追加13 行削除
  1. 10 13
      application/service/UserOrderService.php

+ 10 - 13
application/service/UserOrderService.php

@@ -106,19 +106,16 @@ class UserOrderService{
     }
 
     protected function distance(){
-        if($this->order['freight']=='air') {
-            $this->order['distance'] = ll_distance(
-                $this->order['from_longitude'],
-                $this->order['from_latitude'],
-                $this->order['to_longitude'],
-                $this->order['to_latitude']
-            );
-        }else{
-            $this->order['distance']=tm()->getDistance(
-                [$this->order['from_longitude'],$this->order['from_latitude']],
-                [$this->order['to_longitude'],$this->order['to_latitude']]
-            )['distance'];
-        }
+        $this->order['distance_air'] = ll_distance(
+            $this->order['from_longitude'],
+            $this->order['from_latitude'],
+            $this->order['to_longitude'],
+            $this->order['to_latitude']
+        );
+        $this->order['distance']=tm()->getDistance(
+            [$this->order['from_longitude'],$this->order['from_latitude']],
+            [$this->order['to_longitude'],$this->order['to_latitude']]
+        )['distance'];
         $this->recordLog("距离:{$this->order['distance']}km");
     }