mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
IdoQuery: Join customvars with only live references
This commit is contained in:
parent
00bf541857
commit
4e879ccb9a
@ -1199,14 +1199,32 @@ abstract class IdoQuery extends DbQuery
|
|||||||
|
|
||||||
$this->customVars[strtolower($customvar)] = $alias;
|
$this->customVars[strtolower($customvar)] = $alias;
|
||||||
|
|
||||||
if ($this->hasJoinedVirtualTable('services')) {
|
if ($type === 'host') {
|
||||||
$leftcol = 's.' . $type . '_object_id';
|
if (
|
||||||
} elseif ($type === 'service') {
|
$this instanceof HostserviceproblemsummaryQuery
|
||||||
$this->requireVirtualTable('services');
|
|| $this instanceof ServicecommentQuery
|
||||||
$leftcol = 's.service_object_id';
|
|| $this instanceof ServicedowntimeQuery
|
||||||
} else {
|
|| $this instanceof ServicecommenthistoryQuery
|
||||||
$this->requireVirtualTable('hosts');
|
|| $this instanceof ServicedowntimestarthistoryQuery
|
||||||
$leftcol = 'h.host_object_id';
|
|| $this instanceof ServiceflappingstarthistoryQuery
|
||||||
|
|| $this instanceof ServicegroupQuery
|
||||||
|
|| $this instanceof ServicenotificationQuery
|
||||||
|
|| $this instanceof ServicestatehistoryQuery
|
||||||
|
|| $this instanceof ServicestatusQuery
|
||||||
|
) {
|
||||||
|
$this->requireVirtualTable('services');
|
||||||
|
$leftcol = 's.host_object_id';
|
||||||
|
} else {
|
||||||
|
$leftcol = 'ho.object_id';
|
||||||
|
if (! $this->hasJoinedTable('ho')) {
|
||||||
|
$this->requireVirtualTable('hosts');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else { // $type === 'service'
|
||||||
|
$leftcol = 'so.object_id';
|
||||||
|
if (! $this->hasJoinedTable('so')) {
|
||||||
|
$this->requireVirtualTable('services');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$mapped = $this->getMappedField($leftcol);
|
$mapped = $this->getMappedField($leftcol);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user