提交 90241e29 authored 作者: chengye's avatar chengye

修复地图显示bug

上级 b7221ed4
差异被折叠。
...@@ -482,22 +482,38 @@ class Basestation extends Base ...@@ -482,22 +482,38 @@ class Basestation extends Base
} }
} }
public function basestation_map(Request $request){ public function basestation_map(Request $request){
$id= $request->get('id'); $id= $request->get('station_name');
$this->assign('data',$id); $db = Db::connect([
'type' => 'mysql',
'hostname' => '127.0.0.1',
'database' => 'jzdb',
'username' => 'root',
'password' => 'pvv5718J0CwhNfn4B^8^H3igPj#oiQkX',
'hostport' => '10036',
'charset' => 'utf8',
]);
$data=$db->table('jz_message')->field('business_id')->where(['jz_name'=>$id])->find();
$this->assign('data',$data['business_id']);
return $this->fetch('base_map'); return $this->fetch('base_map');
} }
public function basestation_region(Request $request){ public function basestation_region(Request $request){
$db = Db::connect([
$data['station_id'] = $request->get('station_id'); 'type' => 'mysql',
if(empty($data['station_id'])){ 'hostname' => '127.0.0.1',
return json_encode(['code'=>500,'message'=>'ID不能为空']); 'database' => 'jzdb',
'username' => 'root',
'password' => 'pvv5718J0CwhNfn4B^8^H3igPj#oiQkX',
'hostport' => '10036',
'charset' => 'utf8',
]);
$data['business_id']= $request->get('station_id');
if(empty($data['business_id'])){
return json_encode(['code'=>5001,'message'=>'ID不能为空']);
} }
$url=config('database.geturl')."v1/getbaseMap"; $data=$db->table('jz_message')->field('jz_name,project_code,jz_code,jz_longitude,jz_latitude')->where(['business_id'=>$data['business_id']])->find();
$deresult=json_decode(httpPOST($url,$data),true);
return json($deresult['data']); return json($data);
} }
...@@ -566,7 +582,7 @@ class Basestation extends Base ...@@ -566,7 +582,7 @@ class Basestation extends Base
return $this->fetch('base_region'); return $this->fetch('base_region');
} }
public function base_regiondata(Request $request){ public function base_regiondata(Request $request){
$map =[]; $map =[];
$user = session('user'); $user = session('user');
$admi[]=['name','=',$user['name']]; $admi[]=['name','=',$user['name']];
...@@ -628,7 +644,7 @@ public function base_regiondata(Request $request){ ...@@ -628,7 +644,7 @@ public function base_regiondata(Request $request){
$geturl=$url.'?'.$reqstr; $geturl=$url.'?'.$reqstr;
$result=json_decode(curlGet($geturl),true); $result=json_decode(curlGet($geturl),true);
return json($result['data']); return json($result['data']);
} }
//数据导入 //数据导入
public function base_import(Request $request){ public function base_import(Request $request){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论