diff options
author | Simon Rettberg | 2019-11-08 17:43:19 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-11-08 17:43:19 +0100 |
commit | d76ae00275a9f8eff6027b760aa149fe6130aa24 (patch) | |
tree | 60b5a4b79fe1d41d8c75b6453e200058e65d8394 | |
parent | [statistics] Tag clients with overridden config.vars in list view (diff) | |
download | slx-admin-d76ae00275a9f8eff6027b760aa149fe6130aa24.tar.gz slx-admin-d76ae00275a9f8eff6027b760aa149fe6130aa24.tar.xz slx-admin-d76ae00275a9f8eff6027b760aa149fe6130aa24.zip |
[statistics] Fix filtering by prefixing columns with table name
-rw-r--r-- | modules-available/statistics/inc/statisticsfilter.inc.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules-available/statistics/inc/statisticsfilter.inc.php b/modules-available/statistics/inc/statisticsfilter.inc.php index 1556a1e0..934e01da 100644 --- a/modules-available/statistics/inc/statisticsfilter.inc.php +++ b/modules-available/statistics/inc/statisticsfilter.inc.php @@ -76,7 +76,7 @@ class StatisticsFilter $op = 'NOT LIKE'; } - return $this->column . ' ' . $op . ' :' . $key . $addendum; + return 'm.' . $this->column . ' ' . $op . ' :' . $key . $addendum; } /* parse a query into an array of filters */ @@ -440,7 +440,7 @@ class StateStatisticsFilter extends StatisticsFilter if (array_key_exists($this->argument, $map)) { $key = StatisticsFilter::getNewKey($this->column); $args[$key] = $map[$this->argument]; - return " machine.state $neg IN ( :$key ) "; + return " m.state $neg IN ( :$key ) "; } else { Message::addError('invalid-filter-argument', 'state', $this->argument); return ' 1'; @@ -468,7 +468,7 @@ class LocationStatisticsFilter extends StatisticsFilter } $neg = $this->operator === '=' ? '' : 'NOT'; if ($this->argument === 0) { - return "machine.locationid IS $neg NULL"; + return "m.locationid IS $neg NULL"; } else { $key = StatisticsFilter::getNewKey($this->column); if ($recursive) { @@ -476,7 +476,7 @@ class LocationStatisticsFilter extends StatisticsFilter } else { $args[$key] = $this->argument; } - return "machine.locationid $neg IN (:$key)"; + return "m.locationid $neg IN (:$key)"; } } } |