Commit 415a7df7 authored by zhuwei's avatar zhuwei

优化

parent 8088d03b
...@@ -30,13 +30,14 @@ class BatchProcessing extends Basic ...@@ -30,13 +30,14 @@ class BatchProcessing extends Basic
$model = new GBusinessDistrict(); $model = new GBusinessDistrict();
$house_service = new HouseService(); $house_service = new HouseService();
$field = 'id,name,city'; $field = 'id,name,city,longitude';
$get_params = ''; $get_params = '';
$model_res = $model->getBusinessDistrict($field, $get_params); $model_res = $model->getBusinessDistrict($field, $get_params);
$success_num = 0; $success_num = 0;
$fail = 0; $fail = 0;
foreach ($model_res as $key => $v) { foreach ($model_res as $key => $v) {
if(!$v['longitude']){
//dump($v['name']); //dump($v['name']);
//dump($v['city']); //dump($v['city']);
$id = $v['id']; $id = $v['id'];
...@@ -64,6 +65,7 @@ class BatchProcessing extends Basic ...@@ -64,6 +65,7 @@ class BatchProcessing extends Basic
$log_text = '商圈:'.$v['name'].' 城市: '.$v['city'].' 经度: '.$longitude.' 纬度: '.$latitude.' 数据库写入返回值: '.$res; $log_text = '商圈:'.$v['name'].' 城市: '.$v['city'].' 经度: '.$longitude.' 纬度: '.$latitude.' 数据库写入返回值: '.$res;
Log::write($log_text, '获取商圈经纬度'); //记录日志 Log::write($log_text, '获取商圈经纬度'); //记录日志
} }
}
return $this->response("200", "处理完成",['成功数'=>$success_num,'失败数'=>$fail]); return $this->response("200", "处理完成",['成功数'=>$success_num,'失败数'=>$fail]);
} }
......
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