summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/inc/hardwarequerycolumn.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2022-04-13 12:49:41 +0200
committerSimon Rettberg2022-04-13 12:49:41 +0200
commitf0ef328db5fc34db87070dc83e3af9d382a74eed (patch)
tree659ddf697a91daf947b47f0eeda3627ce6929b9f /modules-available/statistics/inc/hardwarequerycolumn.inc.php
parent[inc/Database] Force more sql_mode options in debug mode (diff)
downloadslx-admin-f0ef328db5fc34db87070dc83e3af9d382a74eed.tar.gz
slx-admin-f0ef328db5fc34db87070dc83e3af9d382a74eed.tar.xz
slx-admin-f0ef328db5fc34db87070dc83e3af9d382a74eed.zip
[statistics] Add PCI device filter option
Diffstat (limited to 'modules-available/statistics/inc/hardwarequerycolumn.inc.php')
-rw-r--r--modules-available/statistics/inc/hardwarequerycolumn.inc.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules-available/statistics/inc/hardwarequerycolumn.inc.php b/modules-available/statistics/inc/hardwarequerycolumn.inc.php
index d073530b..5e16bcd9 100644
--- a/modules-available/statistics/inc/hardwarequerycolumn.inc.php
+++ b/modules-available/statistics/inc/hardwarequerycolumn.inc.php
@@ -30,9 +30,9 @@ class HardwareQueryColumn
/**
* Add necessary conditions, joins, columns to final SQL arrays. To be called
* from HardwareQuery::buildQuery().
- * @param bool $groupConcat whether to add distinct GROUP_CONCAT to column.
+ * @param array if column name is in this array, add as distinct GROUP_CONCAT to column.
*/
- public function generate(array &$joins, array &$columns, array &$params, bool $groupConcat)
+ public function generate(array &$joins, array &$columns, array &$params, array $groupConcat = [])
{
if ($this->global) {
$srcTable = 'shw';
@@ -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 ($groupConcat) {
+ if (!in_array($this->alias, $groupConcat)) {
$columns[] = "Group_Concat(DISTINCT $tid.`value` SEPARATOR ', ') AS `{$this->alias}`";
} else {
$columns[] = "$tid.`value` AS `{$this->alias}`";