From b3f164c23f30ad68ba25a86c07c70551b66bea03 Mon Sep 17 00:00:00 2001 From: panliang <1163816051@qq.com> Date: Wed, 12 Jun 2024 08:52:03 +0800 Subject: [PATCH] =?UTF-8?q?admin=20=E9=97=A8=E5=BA=97=E5=9D=90=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/Store/StoreController.php | 9 +++++---- app/Admin/Services/StoreService.php | 11 ----------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/app/Admin/Controllers/Store/StoreController.php b/app/Admin/Controllers/Store/StoreController.php index 874747b..c91557a 100644 --- a/app/Admin/Controllers/Store/StoreController.php +++ b/app/Admin/Controllers/Store/StoreController.php @@ -113,10 +113,10 @@ class StoreController extends AdminController ->showSteps(false) ->required(), amis()->InputCityControl()->name('region')->label(__('store.region'))->allowDistrict(false)->extractValue(false)->required(), - amis()->TextControl()->name('location.address')->label(__('store.address'))->required(), + amis()->TextControl()->name('address')->label(__('store.address'))->required(), amis()->GroupControl()->label(__('store.location'))->body([ - amis()->TextControl()->name('location.lng')->placeholder('106.65781638883')->label(false), - amis()->TextControl()->name('location.lat')->placeholder('29.033745284277')->label(false), + amis()->TextControl()->name('lon')->placeholder('106.65781638883')->label(false), + amis()->TextControl()->name('lat')->placeholder('29.033745284277')->label(false), ])->description('参考: https://api.map.baidu.com/lbsapi/getpoint/index.html')->required(), // amis()->LocationControl()->name('location')->label(__('store.location'))->coordinatesType('gcj02')->ak(config('baidu.js_secret'))->autoSelectCurrentLoc()->required(), ]); @@ -132,7 +132,8 @@ class StoreController extends AdminController ['label' => __('store.business_id'), 'content' => '${business.name}'], ['label' => __('store.level_id'), 'content' => '${level.name}'], ['label' => __('store.region'), 'content' => '${region.province}-${region.city}'], - ['label' => __('store.address'), 'content' => '${address}', 'span' => 2], + ['label' => __('store.address'), 'content' => '${address}'], + ['label' => __('store.location'), 'content' => '${lon},${lat}'], ['label' => __('store.profit_ratio'), 'content' => '${profit_ratio}%', 'span' => 3], ]); diff --git a/app/Admin/Services/StoreService.php b/app/Admin/Services/StoreService.php index bfdc9dc..e0eada1 100644 --- a/app/Admin/Services/StoreService.php +++ b/app/Admin/Services/StoreService.php @@ -100,17 +100,6 @@ class StoreService extends BaseService return true; } - public function resloveData($data, $model = null) - { - if (isset($data['location'])) { - $data['lon'] = data_get($data['location'], 'lng'); - $data['lat'] = data_get($data['location'], 'lat'); - $data['address'] = data_get($data['location'], 'address'); - } - - return $data; - } - public function validate($data, $model = null) { $createRules = [