sources api

This commit is contained in:
merdan 2022-09-29 18:20:02 +05:00
parent 7c733df020
commit f87c68fbcf
2 changed files with 14 additions and 14 deletions

View File

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

View File

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