Commit 3fff4fd2 authored by zhuwei's avatar zhuwei

代码优化

parent 6f90c08a
......@@ -3,6 +3,7 @@
namespace app\index\controller;
use app\index\extend\Basic;
use app\index\service\HouseService;
use app\model\GBusinessDistrict;
use think\Log;
......@@ -27,6 +28,8 @@ class BatchProcessing extends Basic
public function getCityLatAadLng(){
$model = new GBusinessDistrict();
$house_service = new HouseService();
$field = 'id,name,city';
$get_params = '';
$model_res = $model->getBusinessDistrict($field, $get_params);
......@@ -39,16 +42,15 @@ class BatchProcessing extends Basic
$id = $v['id'];
$address = $v['name'];
$city = $v['city'];
$res = $this->getLatLng($address, $city);
/*获取商圈经纬度*/
$res = $house_service->getLatLng($address, $city);
if($res){
$success_num ++;
$longitude = $res['lng'];//'经度'
$latitude = $res['lat'];//'维度'
}else{
$fail ++;
$longitude = '';//'经度'
$latitude = '';//'维度'
$log_text = '商圈:'.$v['name'].' 城市: '.$v['city'].' 数据库ID: '.$id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment