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']]);