Repair sort and get value wifi connection

This commit is contained in:
Haitem
2020-09-15 16:38:11 +02:00
parent 20469c65db
commit c75c67d420
3 changed files with 63 additions and 37 deletions

View File

@@ -3,7 +3,8 @@ class DeviceManager{
public static $devices;
static function getAllDevices () {
return Db::loadAll ("SELECT * FROM devices WHERE approved != ?", Array(2));
return Db::loadAll ("SELECT devices.* FROM devices
WHERE approved != ?", Array(2));
}
static function getAllDevicesInRoom ($roomId = "") {
@@ -27,7 +28,9 @@ class DeviceManager{
}
static function getAllDevicesSorted ($sort, $sortType = "ASC") {
return Db::loadAll ("SELECT devices.* FROM devices LEFT JOIN rooms ON devices.room_id = rooms.room_id WHERE devices.approved != ? ORDER BY $sort $sortType", Array(2));
return Db::loadAll ("SELECT devices.* FROM devices
LEFT JOIN rooms ON (devices.room_id = rooms.room_id)
WHERE devices.approved != ? ORDER BY $sort $sortType", Array(2));
}
public static function create ($name, $token) {