mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-26 03:09:10 +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()
|
protected function joinHosts()
|
||||||
{
|
{
|
||||||
$columns = array_keys(
|
$columns = array_keys($this->columnMap['hosts']);
|
||||||
$this->columnMap['notifications'] + $this->columnMap['hosts']
|
|
||||||
);
|
|
||||||
foreach ($this->columnMap['services'] as $column => $_) {
|
foreach ($this->columnMap['services'] as $column => $_) {
|
||||||
$columns[$column] = new Zend_Db_Expr('NULL');
|
$columns[$column] = new Zend_Db_Expr('NULL');
|
||||||
}
|
}
|
||||||
if ($this->fetchHistoryColumns) {
|
if ($this->fetchHistoryColumns) {
|
||||||
$columns = array_merge($columns, array_keys($this->columnMap['history']));
|
$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);
|
$hosts = $this->createSubQuery('hostnotification', $columns);
|
||||||
$this->subQueries[] = $hosts;
|
$this->subQueries[] = $hosts;
|
||||||
@ -115,11 +116,12 @@ class NotificationQuery extends IdoQuery
|
|||||||
*/
|
*/
|
||||||
protected function joinServices()
|
protected function joinServices()
|
||||||
{
|
{
|
||||||
$columns = array_keys(
|
$columns = array_keys($this->columnMap['hosts'] + $this->columnMap['services']);
|
||||||
$this->columnMap['notifications'] + $this->columnMap['hosts'] + $this->columnMap['services']
|
|
||||||
);
|
|
||||||
if ($this->fetchHistoryColumns) {
|
if ($this->fetchHistoryColumns) {
|
||||||
$columns = array_merge($columns, array_keys($this->columnMap['history']));
|
$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);
|
$services = $this->createSubQuery('servicenotification', $columns);
|
||||||
$this->subQueries[] = $services;
|
$this->subQueries[] = $services;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user