diff --git a/app/Service/v3/Implementations/StoreService.php b/app/Service/v3/Implementations/StoreService.php index 2ef73e4..cb9092a 100644 --- a/app/Service/v3/Implementations/StoreService.php +++ b/app/Service/v3/Implementations/StoreService.php @@ -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();