From 9214b97f524be65a7183f5c92926ae0fd535d3e1 Mon Sep 17 00:00:00 2001 From: panliang <1163816051@qq.com> Date: Wed, 15 Feb 2023 17:13:58 +0800 Subject: [PATCH] 1 --- app/Endpoint/Api/Http/Controllers/StoreController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Endpoint/Api/Http/Controllers/StoreController.php b/app/Endpoint/Api/Http/Controllers/StoreController.php index 1ae01c9a..f511c14b 100644 --- a/app/Endpoint/Api/Http/Controllers/StoreController.php +++ b/app/Endpoint/Api/Http/Controllers/StoreController.php @@ -49,9 +49,8 @@ class StoreController extends Controller $list = $store->productSpus() ->with(['specs']) ->filter($input) - ->field(['product_spus.id']) ->wherePivot('status', 1) - ->groupBy('product_spus.id') + ->distinct('product_spus.id') ->simplePaginate(Paginator::resolvePerPage('per_page', 20, 50)); return StoreProductSpuResource::collection($list);