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');