From 136f91cc8c0c93560eedf43b81cdfa47c1e92949 Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Fri, 18 Oct 2024 10:24:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E7=94=9F=E6=B4=BB=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E9=A9=BB=E4=BF=A1=E6=81=AF=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=BB=8F=E7=BA=AC=E5=BA=A6=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/LocalStore.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/api/controller/LocalStore.php b/app/api/controller/LocalStore.php index 842252cc..d899103b 100755 --- a/app/api/controller/LocalStore.php +++ b/app/api/controller/LocalStore.php @@ -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");