Some edit

This commit is contained in:
Haitem
2020-07-04 20:06:54 +02:00
parent cdcddffc69
commit 61a1b5057c
4 changed files with 179 additions and 37 deletions

View File

@@ -25,9 +25,9 @@ class SubDeviceManager
}
}
public static function getSubDeviceByMasterAndType($deviceId, $subDeviceType = null)
public static function getSubDeviceByMasterAndType($deviceId, $subDeviceType = '')
{
if (!empty($subDeviceType)) {
if ($subDeviceType == '') {
return Db::loadOne("SELECT * FROM subdevices WHERE device_id = ?;", array($deviceId));
} else {
return Db::loadOne("SELECT * FROM subdevices WHERE device_id = ? AND type = ?;", array($deviceId, $subDeviceType));