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