From f87c68fbcf7f2ff63eca49c3a4331fb65491cf17 Mon Sep 17 00:00:00 2001 From: merdan Date: Thu, 29 Sep 2022 18:20:02 +0500 Subject: [PATCH] sources api --- .../Shop/src/Repositories/ProductRepository.php | 13 ++++++++----- .../src/Repositories/ProductRepository.php | 15 ++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/Sarga/Shop/src/Repositories/ProductRepository.php b/packages/Sarga/Shop/src/Repositories/ProductRepository.php index cd365575a..10f56d60f 100644 --- a/packages/Sarga/Shop/src/Repositories/ProductRepository.php +++ b/packages/Sarga/Shop/src/Repositories/ProductRepository.php @@ -834,11 +834,14 @@ class ProductRepository extends WProductRepository $queries = explode('_', $term); $results = app(ProductFlatRepository::class)->getModel()::search(implode(' OR ', $queries)) - ->where('status', 1) - ->where('visible_individually', 1) - ->where('channel', $channel) - ->where('locale', $locale) - ->orderBy('product_id', 'desc') + ->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(request()->input('limit')??10); } else { $results = app(ProductFlatRepository::class)->scopeQuery(function ($query) use ($term, $channel, $locale) { diff --git a/packages/Webkul/Product/src/Repositories/ProductRepository.php b/packages/Webkul/Product/src/Repositories/ProductRepository.php index 4fec0da51..c53d47876 100755 --- a/packages/Webkul/Product/src/Repositories/ProductRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductRepository.php @@ -459,15 +459,12 @@ class ProductRepository extends Repository $queries = explode('_', $term); $results = app(ProductFlatRepository::class)->getModel()::search(implode(' OR ', $queries)) - ->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(20); + ->where('status', 1) + ->where('visible_individually', 1) + ->where('channel', $channel) + ->where('locale', $locale) + ->orderBy('product_id', 'desc') + ->paginate(16); } else { $results = app(ProductFlatRepository::class)->scopeQuery(function ($query) use ($term, $channel, $locale) {