IDO: treat contacts of services of hosts as direct contacts of the hosts

refs #3088
This commit is contained in:
Alexander A. Klimov 2018-04-06 15:16:36 +02:00
parent 96aac70109
commit bbca113adc
1 changed files with 2 additions and 1 deletions

View File

@ -148,6 +148,7 @@ class ContactQuery extends IdoQuery
*/ */
protected function joinHosts() protected function joinHosts()
{ {
$this->requireVirtualTable('services');
$this->select->joinLeft( $this->select->joinLeft(
array('hc' => $this->prefix . 'host_contacts'), array('hc' => $this->prefix . 'host_contacts'),
'hc.contact_object_id = c.contact_object_id', 'hc.contact_object_id = c.contact_object_id',
@ -158,7 +159,7 @@ class ContactQuery extends IdoQuery
array() array()
)->joinLeft( )->joinLeft(
array('ho' => $this->prefix . 'objects'), array('ho' => $this->prefix . 'objects'),
'ho.object_id = h.host_object_id AND ho.is_active = 1', '(ho.object_id = h.host_object_id OR ho.object_id = s.host_object_id) AND ho.is_active = 1',
array() array()
); );
} }