From 3fa557124462b421f49edc47788ec5687a3483e7 Mon Sep 17 00:00:00 2001 From: Wayne <943146732@qq.com> Date: Wed, 28 Feb 2024 22:04:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/model/store/Shop.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/store/model/store/Shop.php b/app/store/model/store/Shop.php index 75557589..e677b644 100644 --- a/app/store/model/store/Shop.php +++ b/app/store/model/store/Shop.php @@ -127,9 +127,11 @@ class Shop extends ShopModel $data['latitude'] = $coordinate[0]; $data['longitude'] = $coordinate[1]; // 格式化停车场坐标信息 - $parking_coordinate = explode(',', $data['parking_coordinate']); - $data['parking_latitude'] = $parking_coordinate[0]; - $data['parking_longitude'] = $parking_coordinate[1]; + if (!empty($data['parking_coordinate'])) { + $parking_coordinate = explode(',', $data['parking_coordinate']); + $data['parking_latitude'] = $parking_coordinate[0]; + $data['parking_longitude'] = $parking_coordinate[1]; + } // 生成geohash $data['geohash'] = (new Geohash)->encode($data['longitude'], $data['latitude']); // 省市区ID