|
|
@ -28,7 +28,11 @@ class GoodsRecommendController extends BaseController |
|
|
$page = $this->request->input('page', 1); |
|
|
$page = $this->request->input('page', 1); |
|
|
$pagesize = $this->request->input('pagesize', 10); |
|
|
$pagesize = $this->request->input('pagesize', 10); |
|
|
|
|
|
|
|
|
$builder = Goods::query()->with('store')->where('market_id', $marketId); |
|
|
|
|
|
|
|
|
$builder = Goods::query()->with('store') |
|
|
|
|
|
->where('market_id', $marketId) |
|
|
|
|
|
->where(function ($query) { |
|
|
|
|
|
$query->where('inventory', '>', 0)->orWhere('is_infinite', '=', 1); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
switch ($tab) { |
|
|
switch ($tab) { |
|
|
case Tabs::APPLET_INDEX_RECOMMEND: |
|
|
case Tabs::APPLET_INDEX_RECOMMEND: |
|
|
@ -67,6 +71,9 @@ class GoodsRecommendController extends BaseController |
|
|
$goods = Goods::query() |
|
|
$goods = Goods::query() |
|
|
->with(['store']) |
|
|
->with(['store']) |
|
|
->where('market_id', $marketId) |
|
|
->where('market_id', $marketId) |
|
|
|
|
|
->where(function ($query) { |
|
|
|
|
|
$query->where('inventory', '>', 0)->orWhere('is_infinite', '=', 1); |
|
|
|
|
|
}) |
|
|
->inRandomOrder() |
|
|
->inRandomOrder() |
|
|
->limit(20) |
|
|
->limit(20) |
|
|
->get()->toArray(); |
|
|
->get()->toArray(); |
|
|
|