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