From 9ed7cc758a5d8239ab445ab379a452efe60c3fba Mon Sep 17 00:00:00 2001 From: weigang Date: Mon, 7 Sep 2020 20:25:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E5=B8=82=E5=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/v3/GoodsRecommendController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Controller/v3/GoodsRecommendController.php b/app/Controller/v3/GoodsRecommendController.php index 3b6d896..74ffa30 100644 --- a/app/Controller/v3/GoodsRecommendController.php +++ b/app/Controller/v3/GoodsRecommendController.php @@ -24,10 +24,11 @@ class GoodsRecommendController extends BaseController public function getByTabsForAppletIndex() { $tab = $this->request->input('tab', ''); + $marketId = $this->request->input('market_id', 0); $page = $this->request->input('page', 1); $pagesize = $this->request->input('pagesize', 10); - $builder = Goods::query()->with('store'); + $builder = Goods::query()->with('store')->where('market_id', $marketId); switch ($tab) { case Tabs::APPLET_INDEX_RECOMMEND: @@ -62,8 +63,10 @@ class GoodsRecommendController extends BaseController */ public function getByTab() { + $marketId = $this->request->input('market_id', 0); $goods = Goods::query() ->with(['store']) + ->where('market_id', $marketId) ->inRandomOrder() ->limit(20) ->get()->toArray();