Browse Source

分市场

master
weigang 6 years ago
parent
commit
9ed7cc758a
  1. 5
      app/Controller/v3/GoodsRecommendController.php

5
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();

Loading…
Cancel
Save