tongshanglei 2 years ago
parent
commit
7f3f0fdc60
1 changed files with 3 additions and 0 deletions
  1. 3 0
      catch/device/controller/Station.php

+ 3 - 0
catch/device/controller/Station.php

@@ -42,6 +42,9 @@ class Station extends CatchController
         $params=$request->post();
         $shortcode=$this->stationModel->order('shortcode','desc')->value('shortcode');
         $params['shortcode']=$shortcode+1;
+        $gcjLoc = \algorithm\Geometry::convertBd09ToGcj02((float)$params['latitude'],(float)$params['longitude']);
+        $params['longitude']=$gcjLoc['lng'];
+        $params['latitude']=$gcjLoc['lat'];
         return CatchResponse::success($this->stationModel->storeBy($params));
     }