sources api

This commit is contained in:
merdan 2022-09-29 19:13:48 +05:00
parent ff196eb5cd
commit 40fe48d1a3
1 changed files with 10 additions and 10 deletions

View File

@ -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();