search fix
This commit is contained in:
parent
adf9446fc3
commit
6ef8d44200
|
|
@ -99,11 +99,12 @@ class BrandRepository extends Repository
|
|||
}
|
||||
|
||||
public function search($key){
|
||||
$brands = $this->getModel()::search(implode(' OR ', $key))
|
||||
// ->where('status',1)
|
||||
// ->orderBy('name','asc')
|
||||
$brands = $this->getModel()::search(implode(' OR ', $key),function($meilisearch, $query, $options){
|
||||
$options['sort'] = ['name:asc'];
|
||||
return $meilisearch->rawSearch($query, $options);
|
||||
})
|
||||
->take(10)
|
||||
->query(fn ($query) => $query->select('id','name')->orderBy('name'))
|
||||
->query(fn ($query) => $query->select('id','name'))
|
||||
->get();
|
||||
|
||||
return $brands;
|
||||
|
|
|
|||
Loading…
Reference in New Issue