Buscar por rut
This commit is contained in:
@ -54,10 +54,10 @@ class Search
|
||||
}
|
||||
protected function find(string $query, string $tipo): array
|
||||
{
|
||||
preg_match_all('/["\']([\s\w]+)["\']|(\w+)/iu', $query, $matches, PREG_SET_ORDER | PREG_UNMATCHED_AS_NULL);
|
||||
preg_match_all('/["\']([\s\w\-]+)["\']|([\w\-]+)/iu', $query, $matches, PREG_SET_ORDER | PREG_UNMATCHED_AS_NULL);
|
||||
$queries = array_map(function($match) {
|
||||
array_shift($match);
|
||||
$valid = array_filter($match, function($line) {return $line !== null;});
|
||||
$valid = array_filter($match, function($line) {return $line !== null and trim($line); });
|
||||
return implode(' ', $valid);
|
||||
}, $matches);
|
||||
$tiposUnidades = $this->getTiposUnidades();
|
||||
|
Reference in New Issue
Block a user