sources api

This commit is contained in:
merdan 2022-09-29 18:00:31 +05:00
parent 3f973daa2e
commit 0516a4e4d3
2 changed files with 6 additions and 6 deletions

View File

@ -830,7 +830,7 @@ class ProductRepository extends WProductRepository
->where('visible_individually', 1)
->orderBy('product_id', 'desc')
->paginate(request()->input('limit')??10);
} else if (config('scout.driver') == 'elastic') {
} else if (config('scout.driver') == 'meilisearch') {
$queries = explode('_', $term);
$results = app(ProductFlatRepository::class)->getModel()::search(implode(' OR ', $queries))

View File

@ -433,7 +433,7 @@ class ProductRepository extends Repository
$channel = core()->getRequestedChannelCode();
$locale = core()->getRequestedLocaleCode();
\Log::info(config('scout.driver'));
if (config('scout.driver') == 'algolia') {
$results = app(ProductFlatRepository::class)->getModel()::search('query', function ($searchDriver, string $query, array $options) use ($term, $channel, $locale) {
$queries = explode('_', $term);
@ -459,10 +459,10 @@ class ProductRepository extends Repository
$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)
->where('status', 1)
->where('visible_individually', 1)
->where('channel', $channel)
->where('locale', $locale)
->orderBy('product_id', 'desc')
->paginate(16);
} else {