From 40fe48d1a397ffc02e10f844cd7956ff78ae0b04 Mon Sep 17 00:00:00 2001 From: merdan Date: Thu, 29 Sep 2022 19:13:48 +0500 Subject: [PATCH] sources api --- .../API/Http/Controllers/SearchController.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/Sarga/API/Http/Controllers/SearchController.php b/packages/Sarga/API/Http/Controllers/SearchController.php index ada0cd9ee..2d2361efb 100644 --- a/packages/Sarga/API/Http/Controllers/SearchController.php +++ b/packages/Sarga/API/Http/Controllers/SearchController.php @@ -67,19 +67,19 @@ class SearchController extends V1Controller private function searchProducts($key){ - $channel = core()->getRequestedChannelCode(); +// $channel = core()->getRequestedChannelCode(); - $locale = core()->getRequestedLocaleCode(); +// $locale = core()->getRequestedLocaleCode(); $products = $this->productFlatRepository->getModel()::search(implode(' OR ', $key)) - ->where('channel', $channel) - ->where('locale', $locale) - - ->take(50) - ->query(fn ($query) => $query->select('id','name','product_id','description') - ->where('status', 1) - ->where('visible_individually', 1) +// ->where('channel', $channel) +// ->where('locale', $locale) + ->where('status', 1) + ->where('visible_individually', 1) // ->addSelect(DB::raw("\'product\' as type" )) - ->orderBy('name')) + ->orderBy('name') + ->take(50) + ->query(fn ($query) => $query->select('id','name','product_id','description')) + // ->take(10) ->get();