Обновлен вывод сведений о жк в таблице
This commit is contained in:
parent
0e7eff14a4
commit
19af080e3e
@ -102,6 +102,19 @@ function getClients()
|
|||||||
->with('deals');
|
->with('deals');
|
||||||
$clients = $clients->select('users.*');
|
$clients = $clients->select('users.*');
|
||||||
$clients = $clients->orderBy('name');
|
$clients = $clients->orderBy('name');
|
||||||
|
$clients->join('deals', 'deal_clients.deal_id', '=', 'deals.id');
|
||||||
|
|
||||||
|
if (array_key_exists('status', $this->filter)) {
|
||||||
|
$clients->where('deals.status', $this->filter['status']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists('complexes', $this->filter)) {
|
||||||
|
$complexes = [];
|
||||||
|
foreach ($this->filter['complexes'] as $selectedComplex) {
|
||||||
|
$complexes[] = $selectedComplex['id'];
|
||||||
|
}
|
||||||
|
$clients->whereIn('deals.complex_id', $complexes);
|
||||||
|
}
|
||||||
|
|
||||||
if (array_key_exists('search', $this->filter) && $searchString = trim($this->filter['search'])) {
|
if (array_key_exists('search', $this->filter) && $searchString = trim($this->filter['search'])) {
|
||||||
$clients->whereFullText(['name', 'phone', 'email'], $this->filter['search']);
|
$clients->whereFullText(['name', 'phone', 'email'], $this->filter['search']);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user