diff options
author | Simon Rettberg | 2022-04-19 11:25:35 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-04-19 11:25:35 +0200 |
commit | 0fecb411c577fe91691d6ac6be322cbc05da9e48 (patch) | |
tree | 7333681d242e501187b39a4ceb031e2cd8766496 /modules-available/statistics/inc | |
parent | Formatting/minor refactoring (diff) | |
download | slx-admin-0fecb411c577fe91691d6ac6be322cbc05da9e48.tar.gz slx-admin-0fecb411c577fe91691d6ac6be322cbc05da9e48.tar.xz slx-admin-0fecb411c577fe91691d6ac6be322cbc05da9e48.zip |
[statistics] Fix hwquery grouping
Diffstat (limited to 'modules-available/statistics/inc')
-rw-r--r-- | modules-available/statistics/inc/hardwareinfo.inc.php | 2 | ||||
-rw-r--r-- | modules-available/statistics/inc/hardwarequerycolumn.inc.php | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/modules-available/statistics/inc/hardwareinfo.inc.php b/modules-available/statistics/inc/hardwareinfo.inc.php index 6ca070ee..36e99ba5 100644 --- a/modules-available/statistics/inc/hardwareinfo.inc.php +++ b/modules-available/statistics/inc/hardwareinfo.inc.php @@ -50,7 +50,7 @@ class HardwareInfo $hw->addGlobalColumn('vendor'); $hw->addGlobalColumn('device'); $hw->addLocalColumn('slot'); - $res = $hw->query(); + $res = $hw->query(['vendor', 'device']); $passthrough = []; $slots = []; $gvt = false; diff --git a/modules-available/statistics/inc/hardwarequerycolumn.inc.php b/modules-available/statistics/inc/hardwarequerycolumn.inc.php index 5e16bcd9..0f8574f1 100644 --- a/modules-available/statistics/inc/hardwarequerycolumn.inc.php +++ b/modules-available/statistics/inc/hardwarequerycolumn.inc.php @@ -53,7 +53,7 @@ class HardwareQueryColumn // INNER JOIN, so the result will be empty if the condition doesn't match. $type = count($this->conditions) === 1 ? 'LEFT' : 'INNER'; $joins[] = "$type JOIN $table $tid ON (" . implode(' AND ', $this->conditions) . ")"; - if (!in_array($this->alias, $groupConcat)) { + if (!empty($groupConcat) && !in_array($this->alias, $groupConcat)) { $columns[] = "Group_Concat(DISTINCT $tid.`value` SEPARATOR ', ') AS `{$this->alias}`"; } else { $columns[] = "$tid.`value` AS `{$this->alias}`"; @@ -85,4 +85,4 @@ class HardwareQueryColumn } } -}
\ No newline at end of file +} |