diff --git a/packages/Sarga/API/Http/Controllers/SearchController.php b/packages/Sarga/API/Http/Controllers/SearchController.php index b5e3b4810..f5123f49e 100644 --- a/packages/Sarga/API/Http/Controllers/SearchController.php +++ b/packages/Sarga/API/Http/Controllers/SearchController.php @@ -73,11 +73,11 @@ class SearchController extends V1Controller $products = $this->productFlatRepository->getModel()::search(implode(' OR ', $key)) // ->where('channel', $channel) // ->where('locale', $locale) - ->where('status', 1) - ->where('visible_individually', 1) + ->take(50) ->query(fn ($query) => $query->select('id','name','product_id','description') - + ->where('status', 1) + ->where('visible_individually', 1) // ->addSelect(DB::raw("\'product\' as type" )) ->orderBy('name')) // ->take(10) diff --git a/packages/Webkul/Product/src/Repositories/ProductRepository.php b/packages/Webkul/Product/src/Repositories/ProductRepository.php index 176a31630..4fec0da51 100755 --- a/packages/Webkul/Product/src/Repositories/ProductRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductRepository.php @@ -459,12 +459,15 @@ class ProductRepository extends Repository $queries = explode('_', $term); $results = app(ProductFlatRepository::class)->getModel()::search(implode(' OR ', $queries)) - ->where('status', 1) - ->where('visible_individually', 1) + ->query(fn ($query) => $query->select('id','name','product_id','description') + ->where('status', 1) + ->where('visible_individually', 1) +// ->addSelect(DB::raw("\'product\' as type" )) + ->orderBy('name')) // ->where('channel', $channel) // ->where('locale', $locale) - ->orderBy('product_id', 'desc') - ->paginate(16); +// ->orderBy('product_id', 'desc') + ->paginate(20); } else { $results = app(ProductFlatRepository::class)->scopeQuery(function ($query) use ($term, $channel, $locale) {