本地生活添加入驻信息增加经纬度转换

This commit is contained in:
wangxiaowei 2024-10-18 10:24:14 +08:00
parent 01117df222
commit 136f91cc8c

@ -74,6 +74,18 @@ class LocalStore extends Api
{
$user_id = $this->user_id;
$data = $this->request->param();
// 调用腾讯地图将本地生活地理位置转换为经纬度
try {
$url = 'https://apis.map.qq.com/ws/geocoder/v1?key=' . ConfigServer::get('map', 'tx_map_key') . '&address=' . str_replace(' ', '', $data['address']);
$result = file_get_contents($url);
$location = json_decode($result, true);
dump($location);die;
dump($location);die;
} catch (\Exception $e) {
dump('error: ' . $e->getMessage());die;
}
die;
if (isset($data['lstore_id']) && $data['lstore_id'] != 0) {
$data['store_state'] = 0;
$data['update_time'] = date("Y-m-d H:i:s");