Clean Up
This commit is contained in:
parent
d013788249
commit
8a6185e329
@ -15,13 +15,12 @@ class RoomsApi extends ApiController{
|
|||||||
$subDevicesData = SubDeviceManager::getSubdevicesByRoomIds($roomIds);
|
$subDevicesData = SubDeviceManager::getSubdevicesByRoomIds($roomIds);
|
||||||
|
|
||||||
foreach ($roomsData as $roomKey => $roomData) {
|
foreach ($roomsData as $roomKey => $roomData) {
|
||||||
if ($roomData['device_count'] != 0){
|
if ($roomData['device_count'] == 0) continue;
|
||||||
$response[] = [
|
$response[] = [
|
||||||
'room_id' => $roomData['room_id'],
|
'room_id' => $roomData['room_id'],
|
||||||
'name' => $roomData['name'],
|
'name' => $roomData['name'],
|
||||||
'widgets' => isset($subDevicesData[$roomData['room_id']]) ? $subDevicesData[$roomData['room_id']] : [],
|
'widgets' => isset($subDevicesData[$roomData['room_id']]) ? $subDevicesData[$roomData['room_id']] : [],
|
||||||
];
|
];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$this->response($response);
|
$this->response($response);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user