доработка компоненты вывода клиентов

This commit is contained in:
developer 2026-04-23 15:44:07 +08:00
parent d081571108
commit bc6671bf10

View File

@ -99,16 +99,15 @@ function getClients()
if (array_key_exists('search', $this->filter) && $searchString = trim($this->filter['search'])) {
$clients->whereFullText(['name', 'phone', 'email'], $this->filter['search']);
}
if ($this->status && $this->status == DealStatus::UNIQUE)
if (array_key_exists('status', $this->filter) && $this->status == DealStatus::UNIQUE)
{
$clients = $clients->whereHas('deals', function ($query)
{
$query->where('status', DealStatus::UNIQUE);
})->paginate($this->count, ['*'], 'unique_clients');
}
elseif ($this->status && $this->status == DealStatus::NOT_UNIQUE)
elseif (array_key_exists('status', $this->filter) && $this->status == DealStatus::NOT_UNIQUE)
{
$clients = $clients->whereHas('deals', function ($query)
{