|
|
|
@ -87,7 +87,12 @@ class StoreService implements StoreServiceInterface |
|
|
|
|
|
|
|
$paginate = $builder->groupBy(''.$storeTable.'.id')->orderByDesc($storeTable.'.sales')->paginate($pagesize); |
|
|
|
$stores = $paginate->map(function ($item, $key) { |
|
|
|
$item->goods; |
|
|
|
$item->goods = Goods::query() |
|
|
|
->where('store_id',$item->id) |
|
|
|
->where(function ($query){ |
|
|
|
$query->where('inventory', '>', 0)->orWhere('is_infinite', '=', 1); |
|
|
|
}) |
|
|
|
->limit(5)->get(); |
|
|
|
return $item; |
|
|
|
})->all(); |
|
|
|
|
|
|
|
|