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 = [