summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics_reporting
diff options
context:
space:
mode:
authorSimon Rettberg2017-02-08 15:41:51 +0100
committerSimon Rettberg2017-02-08 15:41:51 +0100
commit2a1d52bbb27fc47093479e9152a4d026856ca84f (patch)
tree27e37515198a7020de412ffcb6853404ab3e26b7 /modules-available/statistics_reporting
parent[statistics_reporting] Implement column filtering for export (diff)
downloadslx-admin-2a1d52bbb27fc47093479e9152a4d026856ca84f.tar.gz
slx-admin-2a1d52bbb27fc47093479e9152a4d026856ca84f.tar.xz
slx-admin-2a1d52bbb27fc47093479e9152a4d026856ca84f.zip
[statistics_reporting] Fix 'Not assigned' row not showing up in locations grouping anymore
Diffstat (limited to 'modules-available/statistics_reporting')
-rw-r--r--modules-available/statistics_reporting/inc/queries.inc.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules-available/statistics_reporting/inc/queries.inc.php b/modules-available/statistics_reporting/inc/queries.inc.php
index 1d1d3a44..bb96a46e 100644
--- a/modules-available/statistics_reporting/inc/queries.inc.php
+++ b/modules-available/statistics_reporting/inc/queries.inc.php
@@ -16,7 +16,7 @@ class Queries
GROUP BY machine.machineuuid
) t1
INNER JOIN (
- SELECT machine.hostname AS 'name', machine.machineuuid AS 'uuid', SUM(CAST(offlineTable.length AS UNSIGNED)) AS 'offlineSum', MAX(offlineTable.dateline) AS 'lastStart'
+ SELECT machine.machineuuid AS 'uuid', SUM(CAST(offlineTable.length AS UNSIGNED)) AS 'offlineSum', MAX(offlineTable.dateline) AS 'lastStart'
FROM ".self::getBoundedTableQueryString('~offline-length', $from, $to, $lowerTimeBound, $upperTimeBound)." offlineTable
INNER JOIN machine ON offlineTable.machineuuid = machine.machineuuid
GROUP BY machine.machineuuid
@@ -35,14 +35,14 @@ class Queries
FROM ".self::getBoundedTableQueryString('~session-length', $from, $to, $lowerTimeBound, $upperTimeBound)." sessionTable
INNER JOIN machine ON sessionTable.machineuuid = machine.machineuuid
LEFT JOIN location ON machine.locationid = location.locationid
- GROUP BY location.locationid
+ GROUP BY machine.locationid
) t1
- INNER JOIN (
- SELECT IFNULL(location.locationname, '$notassigned') AS 'locName', location.locationid AS 'locId', SUM(CAST(offlineTable.length AS UNSIGNED)) AS 'offlineSum'
+ LEFT JOIN (
+ SELECT location.locationid AS 'locId', SUM(CAST(offlineTable.length AS UNSIGNED)) AS 'offlineSum'
FROM ".self::getBoundedTableQueryString('~offline-length', $from, $to, $lowerTimeBound, $upperTimeBound)." offlineTable
INNER JOIN machine ON offlineTable.machineuuid = machine.machineuuid
LEFT JOIN location ON machine.locationid = location.locationid
- GROUP BY location.locationid
+ GROUP BY machine.locationid
) t2
ON t1.locId = t2.locId", array("salt" => GetData::$salt));
return $res;