Ido\Query\: Add objecttype_id checks where missing

This commit is contained in:
Johannes Meyer 2022-02-23 14:34:40 +01:00
parent 9a78fab17b
commit 00bf541857
3 changed files with 5 additions and 5 deletions

View File

@ -89,7 +89,7 @@ class HostcontactQuery extends IdoQuery
[]
)->join(
['co' => $this->prefix . 'objects'],
'co.object_id = c.contact_object_id AND co.is_active = 1',
'co.object_id = c.contact_object_id AND co.is_active = 1 AND co.objecttype_id = 10',
[]
);
@ -153,7 +153,7 @@ class HostcontactQuery extends IdoQuery
[]
)->joinLeft(
['ho' => $this->prefix . 'objects'],
'ho.object_id = h.host_object_id AND ho.is_active = 1',
'ho.object_id = h.host_object_id AND ho.is_active = 1 AND ho.objecttype_id = 1',
[]
);
}

View File

@ -72,7 +72,7 @@ class HostserviceproblemsummaryQuery extends IdoQuery
array()
)->join(
array('s' => $this->prefix . 'services'),
's.service_object_id = so.object_id AND so.is_active = 1',
's.service_object_id = so.object_id AND so.is_active = 1 AND so.objecttype_id = 2',
array()
);
$this->select->group('so.name1');

View File

@ -89,7 +89,7 @@ class ServicecontactQuery extends IdoQuery
[]
)->join(
['co' => $this->prefix . 'objects'],
'co.object_id = c.contact_object_id AND co.is_active = 1',
'co.object_id = c.contact_object_id AND co.is_active = 1 AND co.objecttype_id = 10',
[]
);
@ -163,7 +163,7 @@ class ServicecontactQuery extends IdoQuery
[]
)->joinLeft(
['ho' => $this->prefix . 'objects'],
'ho.object_id = h.host_object_id AND ho.is_active = 1',
'ho.object_id = h.host_object_id AND ho.is_active = 1 AND ho.objecttype_id = 1',
[]
);
}