search fix

This commit is contained in:
merdan 2023-09-15 15:14:11 +05:00
parent 03a8037363
commit c4fe40ebe6
1 changed files with 4 additions and 5 deletions

View File

@ -99,12 +99,11 @@ class BrandRepository extends Repository
}
public function search($key){
$brands = $this->getModel()::search(implode(' OR ', $key),function($meilisearch, $query, $options){
$options['sort'] = ['name:asc'];
return $meilisearch->rawSearch($query, $options);
})
$brands = $this->getModel()::search(implode(' OR ', $key))
// ->where('status',1)
// ->orderBy('name','asc')
->take(10)
->query(fn ($query) => $query->select('id','name'))
->query(fn ($query) => $query->select('id','name')->orderBy('name'))
->get();
return $brands;