From 67738d1fe09a184251fad9b6116f7ca06ad23d00 Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Tue, 1 Sep 2020 14:18:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/v3/LocationController.php | 47 ++++++++++++++++++++++++ config/routes.php | 1 + 2 files changed, 48 insertions(+) diff --git a/app/Controller/v3/LocationController.php b/app/Controller/v3/LocationController.php index a70384f..6708fd6 100644 --- a/app/Controller/v3/LocationController.php +++ b/app/Controller/v3/LocationController.php @@ -36,4 +36,51 @@ class LocationController extends BaseController ] ]); } + + public function getMarketListByLocation() + { + return $this->success([ + '南宁市' => [ + [ + 'id' => 1, + 'name' => '东沟岭菜市', + 'province_id' => 1, + 'province_name' => '广西', + 'city_id' => 2, + 'city_name' => '南宁市', + 'area_id' => 3, + 'area_name' => '良庆区', + 'address' => '青秀区竹塘路17号', + 'lng' => '108.383566', + 'lat' => '22.759946', + ], + [ + 'id' => 2, + 'name' => '铜鼓岭市场', + 'province_id' => 1, + 'province_name' => '广西', + 'city_id' => 2, + 'city_name' => '南宁市', + 'area_id' => 3, + 'area_name' => '良庆区', + 'address' => '青秀区竹塘路17号', + 'lng' => '108.383566', + 'lat' => '22.759946', + ], + [ + 'id' => 3, + 'name' => '华园菜市', + 'province_id' => 1, + 'province_name' => '广西', + 'city_id' => 2, + 'city_name' => '南宁市', + 'area_id' => 3, + 'area_name' => '良庆区', + 'address' => '青秀区竹塘路17号', + 'lng' => '108.383566', + 'lat' => '22.759946', + ], + ] + ]); + } } \ No newline at end of file diff --git a/config/routes.php b/config/routes.php index 014d72a..9e96dd7 100644 --- a/config/routes.php +++ b/config/routes.php @@ -87,6 +87,7 @@ Router::addGroup('/v3/', function () { Router::post('updateShopCart/update', 'App\Controller\v3\UpdateShopCartController@update'); Router::post('shopCart/detail', 'App\Controller\v3\ShopCartController@detail'); Router::post('login/wxLogin', 'App\Controller\v3\LoginController@wxLogin'); + Router::post('location/getMarketListByLocation', 'App\Controller\v3\LocationController@getMarketListByLocation'); },['middleware' => [\App\Middleware\Auth\ApiMiddleware::class]]); // 需要登录的路由