ServicegroupQuery: Really join hosts if instructed to do so

fixes #3983
This commit is contained in:
Johannes Meyer 2019-10-17 15:57:30 +02:00
parent 8d2970a18e
commit 8e51518e96
1 changed files with 11 additions and 0 deletions

View File

@ -33,4 +33,15 @@ class EmptyservicegroupQuery extends ServicegroupQuery
$this->select->group(['sgo.object_id', 'sg.servicegroup_id']);
$this->select->having('COUNT(esgm.servicegroup_member_id) = ?', 0);
}
protected function joinHosts()
{
parent::joinHosts();
$this->select->joinLeft(
['h' => 'icinga_hosts'],
'h.host_object_id = s.host_object_id',
[]
);
}
}