sources api

This commit is contained in:
merdan 2022-09-29 18:18:13 +05:00
parent 2cd62243fa
commit 7c733df020
2 changed files with 10 additions and 7 deletions

View File

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

View File

@ -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) {