mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Use subquery filters for service state history if appropriate
refs #2934
This commit is contained in:
parent
bdb73ec06e
commit
81b6b0129b
@ -33,6 +33,11 @@ class ServicestatehistoryQuery extends IdoQuery
|
|||||||
'hard_state' => 1
|
'hard_state' => 1
|
||||||
);
|
);
|
||||||
|
|
||||||
|
protected $subQueryTargets = array(
|
||||||
|
'hostgroups' => 'hostgroup',
|
||||||
|
'servicegroups' => 'servicegroup'
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
@ -184,4 +189,19 @@ class ServicestatehistoryQuery extends IdoQuery
|
|||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function joinSubQuery(IdoQuery $query, $name)
|
||||||
|
{
|
||||||
|
if ($name === 'hostgroup') {
|
||||||
|
$query->joinVirtualTable('services');
|
||||||
|
|
||||||
|
return ['so.object_id', 'so.object_id'];
|
||||||
|
} elseif ($name === 'servicegroup') {
|
||||||
|
$query->joinVirtualTable('members');
|
||||||
|
|
||||||
|
return ['sgm.service_object_id', 'so.object_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::joinSubQuery($query, $name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user