добавил возможность поиска клиента по номеру в произвольном формате
This commit is contained in:
parent
8a76c75c6a
commit
d66dd3ab2d
@ -120,9 +120,11 @@ function getClients()
|
||||
$searchString = mb_strtolower(trim($this->filter['search']));
|
||||
// $clients->whereFullText(['name', 'phone', 'email', 'normalized_name', 'normalized_phone'], $searchString);
|
||||
$clients->where(function ($query) use ($searchString) {
|
||||
$query->where('normalized_name', 'like', "%{$searchString}%")
|
||||
->orWhere('normalized_phone', 'like', "%{$this->normilizePhone($searchString)}%")
|
||||
->orWhere('email', 'like', "%{$searchString}%");
|
||||
$query->where('normalized_name', 'like', "%{$searchString}%");
|
||||
$query->orWhere('email', 'like', "%{$searchString}%", caseSensitive: false);
|
||||
if ($phoneFormatted = $this->normilizePhone($searchString)) {
|
||||
$query->orWhere('normalized_phone', 'like', "%{$phoneFormatted}%");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user