From b2a11b212bbdc4409396335b6cc8dc898a967f06 Mon Sep 17 00:00:00 2001 From: developer Date: Thu, 2 Apr 2026 11:49:13 +0800 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=B5=D0=BB=D0=B5=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80=20=D0=BF=D0=BE=D0=BC=D0=B5=D1=89=D0=B5=D0=BD=D0=B8=D0=B9?= =?UTF-8?q?=20=D0=B8=D0=B7=20=D0=B0=D0=BF=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Http/Livewire/Plan7SelectorLivewire.php | 18 +- .../Plan7/Views/livewire/selector.blade.php | 256 ++++++++++-------- 2 files changed, 156 insertions(+), 118 deletions(-) diff --git a/app/Modules/Plan7/Http/Livewire/Plan7SelectorLivewire.php b/app/Modules/Plan7/Http/Livewire/Plan7SelectorLivewire.php index 9c9b08e..7f72a86 100644 --- a/app/Modules/Plan7/Http/Livewire/Plan7SelectorLivewire.php +++ b/app/Modules/Plan7/Http/Livewire/Plan7SelectorLivewire.php @@ -14,7 +14,7 @@ class Plan7SelectorLivewire extends Component public $types; public $access; public $summary; - public $room; + public $room = false; public $objects = []; private $apiSummary = 'https://plan7.ru/catalog/exp/json/summary/?token=0754c5e6a3824322&zk=614'; private $apiAll = 'https://plan7.ru/catalog/exp/json/?token=0754c5e6a3824322&zk=614'; @@ -63,7 +63,10 @@ public function setHouse($id) public function setRoom($id) { $this->room = $this->allObjects['data'][$id]; - $this->filter['id'] = $id; + //$this->filter['id'] = $id; + } + public function unsetRoom() { + $this->room = false; } public function resetFilter() { $this->filter = []; @@ -71,6 +74,7 @@ public function resetFilter() { public function start() { $this->mode = 'select'; $this->filter = []; + //$this->room = false; $this->getData(); } public function done() { @@ -83,19 +87,19 @@ public function render() if (count($this->filter)) { foreach ($this->allObjects['data'] as $key => $room) { if ($room['access'] != 0) { - if (array_key_exists('id', $this->filter) && $this->filter['id'] !== null && $room['id'] != $this->filter['id']) { + if (array_key_exists('id', $this->filter) && $this->filter['id'] != null && $room['id'] != $this->filter['id']) { continue; } - if (array_key_exists('bs', $this->filter) && $this->filter['bs'] !== null && $room['bs'] != $this->filter['bs']) { + if (array_key_exists('bs', $this->filter) && $this->filter['bs'] != null && $room['bs'] != $this->filter['bs']) { continue; } - if (array_key_exists('type', $this->filter) && $this->filter['type'] !== null && $room['type'] != $this->filter['type']) { + if (array_key_exists('type', $this->filter) && $this->filter['type'] != null && $room['type'] != $this->filter['type']) { continue; } - if (array_key_exists('min_area', $this->filter) && $this->filter['min_area'] !== null && $room['area'] < $this->filter['min_area']) { + if (array_key_exists('min_area', $this->filter) && $this->filter['min_area'] != null && $room['area'] < $this->filter['min_area']) { continue; } - if (array_key_exists('max_area', $this->filter) && $this->filter['max_area'] !== null && $room['area'] > $this->filter['max_area']) { + if (array_key_exists('max_area', $this->filter) && $this->filter['max_area'] != null && $room['area'] > $this->filter['max_area']) { continue; } $room['mode'] = 'room'; diff --git a/app/Modules/Plan7/Views/livewire/selector.blade.php b/app/Modules/Plan7/Views/livewire/selector.blade.php index 1d8b7ff..35aeef5 100644 --- a/app/Modules/Plan7/Views/livewire/selector.blade.php +++ b/app/Modules/Plan7/Views/livewire/selector.blade.php @@ -13,7 +13,8 @@ @endif - - +