...
|
...
|
@@ -1360,5 +1360,35 @@ class SecondController extends RestBaseController |
|
|
$this->success('',$info);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @title 获取地址位置
|
|
|
* @description 获取地址位置
|
|
|
* @author sgj
|
|
|
* @url /index/second/getAddressInfo
|
|
|
* @method GET
|
|
|
*
|
|
|
* @header name:XX-Token require:1 default: desc:token
|
|
|
* @return code:状态值-1,审核不通过0,待提交信息1,审核中
|
|
|
* @param name:lat type:int require:1 other: desc:纬度
|
|
|
* @param name:lng type:int require:1 other: desc:经度
|
|
|
*@throws
|
|
|
*
|
|
|
*/
|
|
|
public function getAddressInfo(){
|
|
|
$lat=input('lat');
|
|
|
$lng=input('lng');
|
|
|
$key='Y4PBZ-MBQ3Q-XSV5A-GWLXE-HXV4E-JNB3P';
|
|
|
$url='https://apis.map.qq.com/ws/geocoder/v1/?location='.$lat.','.$lng.'&key='.$key;
|
|
|
$info=file_get_contents($url);
|
|
|
$result=json_decode($info,true);
|
|
|
if ($result['status']==0){
|
|
|
$return['address']=$result['result']['address'];
|
|
|
// return $result['result']['address'];
|
|
|
} else{
|
|
|
$return['address']='';
|
|
|
}
|
|
|
$this->success('',$return);
|
|
|
|
|
|
}
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|