From 504698328f80a699aec3ce828f7437256491fdd1 Mon Sep 17 00:00:00 2001 From: weigang Date: Wed, 9 Sep 2020 16:43:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=95=86=E5=93=81=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=AD=97=E6=AE=B5=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/v3/Implementations/SearchService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Service/v3/Implementations/SearchService.php b/app/Service/v3/Implementations/SearchService.php index 660d9dd..9caf6e1 100644 --- a/app/Service/v3/Implementations/SearchService.php +++ b/app/Service/v3/Implementations/SearchService.php @@ -44,7 +44,7 @@ class SearchService implements \App\Service\v3\Interfaces\SearchServiceInterface } } - $builder->select(['id', 'store_id', 'cover_img', 'name', 'spec', 'tags', 'original_price', 'price', 'inventory', 'sales as total_sales']); + $builder->select(['*'])->addSelect(['sales as total_sales']); $paginate = $builder->paginate($params['pagesize']); $goods = $paginate->toArray(); return ['has_more_pages' => $paginate->hasMorePages(), 'goods' => $goods['data']]; @@ -55,7 +55,7 @@ class SearchService implements \App\Service\v3\Interfaces\SearchServiceInterface $builder = Store::query() ->with(['goods' => function($query) { return $query->limit(5) - ->select(['id', 'store_id', 'cover_img', 'name', 'spec', 'tags', 'original_price', 'price', 'inventory', 'sales as total_sales']); + ->select(['*'])->addSelect(['sales as total_sales']); }]) ->where(['market_id' => $params['market_id']]);