sources api
This commit is contained in:
parent
2cd62243fa
commit
7c733df020
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue