Buscar por rut

This commit is contained in:
Juan Pablo Vial
2024-02-27 16:11:48 -03:00
parent cfe18c1909
commit dc7a9f9e7a
2 changed files with 7 additions and 4 deletions

View File

@ -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();