mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 17:54:34 +00:00
Create sorting on table in devices
This commit is contained in:
1 parent
ed732e125a
commit
cc804f36df
3 files changed
+160
-80
No files matched your search
@@ -26,6 +26,10 @@ class DeviceManager{
|
||||
return Db::loadOne("SELECT * FROM devices WHERE device_id = ?", array($deviceId));
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
public static function create ($name, $token) {
|
||||
$defaultRoom = RoomManager::getDefaultRoomId();
|
||||
$device = array (
|
||||
|
||||
Reference in new issue
Block a user