From 990797e6b107437549aa02a3de9f412f62344f3e Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Tue, 13 Oct 2020 16:20:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5tag=E6=9B=B4=E6=94=B9=20?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=96=B0=E5=A2=9E=E5=BA=97=E9=93=BA=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Constants/v3/Tabs.php | 5 +++++ app/Controller/v3/StoreController.php | 9 +++++++++ app/Service/v3/Implementations/StoreService.php | 8 ++++++++ app/Service/v3/Implementations/TabsService.php | 3 ++- app/Service/v3/Interfaces/StoreServiceInterface.php | 1 + config/routes.php | 1 + 6 files changed, 26 insertions(+), 1 deletion(-) diff --git a/app/Constants/v3/Tabs.php b/app/Constants/v3/Tabs.php index 0b95a4f..3866285 100644 --- a/app/Constants/v3/Tabs.php +++ b/app/Constants/v3/Tabs.php @@ -30,6 +30,11 @@ class Tabs extends AbstractConstants */ const APPLET_INDEX_OFFICE = 'applet_index_office'; + /** + * @Message("小程序首页店铺列表") + */ + const APPLET_INDEX_STORE = 'applet_index_store'; + /** * @Message("搜索商品为你推荐") */ diff --git a/app/Controller/v3/StoreController.php b/app/Controller/v3/StoreController.php index 8a883f7..11edf2d 100644 --- a/app/Controller/v3/StoreController.php +++ b/app/Controller/v3/StoreController.php @@ -123,4 +123,13 @@ class StoreController extends BaseController $res = $data['goods_types'] = $this->categoryService->allForStoreIncludeOff($storeId); return $this->success(['goods_types' => $res]); } + + public function getListByMarketId() + { + $marketId = $this->request->input('market_id'); + $page = $this->request->input('page',1); + $pagesize = $this->request->input('pagesize',10); + $res = $this->storeService->getListByMarketId($marketId,$page,$pagesize); + return $this->success($res); + } } \ No newline at end of file diff --git a/app/Service/v3/Implementations/StoreService.php b/app/Service/v3/Implementations/StoreService.php index 2269faf..f162efe 100644 --- a/app/Service/v3/Implementations/StoreService.php +++ b/app/Service/v3/Implementations/StoreService.php @@ -63,4 +63,12 @@ class StoreService implements StoreServiceInterface $market->stores = $stores['data']; return ['has_more_pages' => $paginate->hasMorePages(), 'market' => $market]; } + + public function getListByMarketId($marketId, $page=1, $pagesize=10) + { + $builder = Store::query(); + $paginate = $builder->where('market_id',$marketId)->paginate($pagesize); + $storeList = $paginate->toArray(); + return ['has_more_pages' => $paginate->hasMorePages(), 'store_list' => $storeList['data']]; + } } \ No newline at end of file diff --git a/app/Service/v3/Implementations/TabsService.php b/app/Service/v3/Implementations/TabsService.php index 1c58f98..f662be3 100644 --- a/app/Service/v3/Implementations/TabsService.php +++ b/app/Service/v3/Implementations/TabsService.php @@ -26,10 +26,11 @@ class TabsService implements TabsServiceInterface public function allForAppletIndex() { return [ + ['tab' => Tabs::APPLET_INDEX_STORE, 'title' => '店铺列表', 'subtitle' => '点我进列表', 'badge' => '好多店铺', 'bg_color' => '#FF0000', 'font_color' => '#FFFFFF'], ['tab' => Tabs::APPLET_INDEX_RECOMMEND, 'title' => '猜你喜欢', 'subtitle' => '我是你的菜', 'badge' => '', 'bg_color' => '#FF0000', 'font_color' => '#FFFFFF'], ['tab' => Tabs::APPLET_INDEX_NEW, 'title' => '每日上新', 'subtitle' => '新鲜当日达', 'badge' => '好新鲜', 'bg_color' => '#FF0000', 'font_color' => '#FFFFFF'], ['tab' => Tabs::APPLET_INDEX_FRESH, 'title' => '懒族优选', 'subtitle' => '发现不一样', 'badge' => '', 'bg_color' => '#FF0000', 'font_color' => '#FFFFFF'], - ['tab' => Tabs::APPLET_INDEX_OFFICE, 'title' => '白领餐食', 'subtitle' => '轻奢快手菜', 'badge' => '手到食来', 'bg_color' => '#FF0000', 'font_color' => '#FFFFFF'], + //['tab' => Tabs::APPLET_INDEX_OFFICE, 'title' => '白领餐食', 'subtitle' => '轻奢快手菜', 'badge' => '手到食来', 'bg_color' => '#FF0000', 'font_color' => '#FFFFFF'], ]; } } \ No newline at end of file diff --git a/app/Service/v3/Interfaces/StoreServiceInterface.php b/app/Service/v3/Interfaces/StoreServiceInterface.php index 7d355e9..4b03641 100644 --- a/app/Service/v3/Interfaces/StoreServiceInterface.php +++ b/app/Service/v3/Interfaces/StoreServiceInterface.php @@ -9,4 +9,5 @@ interface StoreServiceInterface public function undo(); public function detail($storeId); public function getList($marketId ,$page=1, $pagesize=10); + public function getListByMarketId($marketId ,$page=1, $pagesize=10); } \ No newline at end of file diff --git a/config/routes.php b/config/routes.php index ec068d8..66697cc 100644 --- a/config/routes.php +++ b/config/routes.php @@ -156,6 +156,7 @@ Router::addGroup('/v3/', function () { Router::post('store/getGoodsByType', 'App\Controller\v3\StoreController@getGoodsByType'); Router::post('goods/update', 'App\Controller\v3\GoodsController@update'); Router::post('store/getList', 'App\Controller\v3\StoreController@getList'); + Router::post('store/getListByMarketId', 'App\Controller\v3\StoreController@getListByMarketId'); Router::post('goods/info', 'App\Controller\v3\GoodsController@info'); Router::post('store/getCategory', 'App\Controller\v3\StoreController@getCategory'); Router::post('category/first', 'App\Controller\v3\CategoryController@first');