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

修复地图显示bug

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