mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 17:24:16 +02:00
NotificationQuery: Do not fetch non-history related columns for history queries
refs #9009
This commit is contained in:
parent
f2425a97d5
commit
dd81de39fd
@ -96,14 +96,15 @@ class NotificationQuery extends IdoQuery
|
||||
*/
|
||||
protected function joinHosts()
|
||||
{
|
||||
$columns = array_keys(
|
||||
$this->columnMap['notifications'] + $this->columnMap['hosts']
|
||||
);
|
||||
$columns = array_keys($this->columnMap['hosts']);
|
||||
foreach ($this->columnMap['services'] as $column => $_) {
|
||||
$columns[$column] = new Zend_Db_Expr('NULL');
|
||||
}
|
||||
if ($this->fetchHistoryColumns) {
|
||||
$columns = array_merge($columns, array_keys($this->columnMap['history']));
|
||||
$columns[] = 'object_type';
|
||||
} else {
|
||||
$columns = array_merge($columns, array_keys($this->columnMap['notifications']));
|
||||
}
|
||||
$hosts = $this->createSubQuery('hostnotification', $columns);
|
||||
$this->subQueries[] = $hosts;
|
||||
@ -115,11 +116,12 @@ class NotificationQuery extends IdoQuery
|
||||
*/
|
||||
protected function joinServices()
|
||||
{
|
||||
$columns = array_keys(
|
||||
$this->columnMap['notifications'] + $this->columnMap['hosts'] + $this->columnMap['services']
|
||||
);
|
||||
$columns = array_keys($this->columnMap['hosts'] + $this->columnMap['services']);
|
||||
if ($this->fetchHistoryColumns) {
|
||||
$columns = array_merge($columns, array_keys($this->columnMap['history']));
|
||||
$columns[] = 'object_type';
|
||||
} else {
|
||||
$columns = array_merge($columns, array_keys($this->columnMap['notifications']));
|
||||
}
|
||||
$services = $this->createSubQuery('servicenotification', $columns);
|
||||
$this->subQueries[] = $services;
|
||||
|
Loading…
x
Reference in New Issue
Block a user