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