From e3269131e6a35b4733360a588322ec8b07f6843f Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 5 Sep 2020 20:02:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96=E5=B8=82?= =?UTF-8?q?=E5=9C=BA=E4=BF=A1=E6=81=AF=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 | 9 +++++++++ app/Service/v3/Implementations/LocationService.php | 6 ++++++ app/Service/v3/Interfaces/LocationServiceInterface.php | 1 + config/routes.php | 1 + 4 files changed, 17 insertions(+) diff --git a/app/Controller/v3/LocationController.php b/app/Controller/v3/LocationController.php index b46ceac..bee31f0 100644 --- a/app/Controller/v3/LocationController.php +++ b/app/Controller/v3/LocationController.php @@ -49,4 +49,13 @@ class LocationController extends BaseController $cityIds = [2163,2189]; return $this->success($this->locationService->getMarketListByLocation($cityIds)); } + + public function getMarketsInfo() + { + $ret = []; + $ret['service_time']='8:30-20:00'; + $ret['markets_info']=$this->locationService->getMarketsInfo(); + + return $ret; + } } \ No newline at end of file diff --git a/app/Service/v3/Implementations/LocationService.php b/app/Service/v3/Implementations/LocationService.php index c922c74..f34afb6 100644 --- a/app/Service/v3/Implementations/LocationService.php +++ b/app/Service/v3/Implementations/LocationService.php @@ -72,4 +72,10 @@ class LocationService implements LocationServiceInterface return round($distance, $decimal); } + + //获取服务站信息 + function getMarketsInfo() + { + return Market::where('status',1)->get(); + } } \ No newline at end of file diff --git a/app/Service/v3/Interfaces/LocationServiceInterface.php b/app/Service/v3/Interfaces/LocationServiceInterface.php index 6bed48b..688ae98 100644 --- a/app/Service/v3/Interfaces/LocationServiceInterface.php +++ b/app/Service/v3/Interfaces/LocationServiceInterface.php @@ -11,4 +11,5 @@ interface LocationServiceInterface public function undo(); public function getMarketListByLocation($cityIds); public function searchMarket($key,$cityId = 2163); + public function getMarketsInfo(); } \ No newline at end of file diff --git a/config/routes.php b/config/routes.php index 52d47e7..0d898fc 100644 --- a/config/routes.php +++ b/config/routes.php @@ -91,6 +91,7 @@ Router::addGroup('/v3/', function () { Router::post('goodsRecommend/getByTab', 'App\Controller\v3\GoodsRecommendController@getByTab'); Router::post('store/index', 'App\Controller\v3\StoreController@index'); Router::post('Search/market', 'App\Controller\v3\SearchController@market'); + Router::post('market/services', 'App\Controller\v3\LocationController@getMarketsInfo'); },['middleware' => [\App\Middleware\Auth\ApiMiddleware::class]]); // 需要登录的路由