From dd2a4b8df3aa0c8c85cc01f34aa1b82e5f01de85 Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Mon, 2 Nov 2020 16:15:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/v3/Implementations/StoreService.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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();