mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2026-05-28 04:35:53 -04:00
IcingaServiceSetServiceTable: Change table alias for director branches
This commit is contained in:
parent
ca855c6ee7
commit
76509bb7c8
1 changed files with 3 additions and 1 deletions
|
|
@ -199,11 +199,13 @@ class IcingaServiceSetServiceTable extends ZfQueryBasedTable
|
|||
assert($connection instanceof Db);
|
||||
$builder = new ServiceSetQueryBuilder($connection, $this->branchUuid);
|
||||
$query = $builder->selectServicesForSet($this->set);
|
||||
$alias = $this->branchUuid ? 'u' : 'o';
|
||||
|
||||
if ($this->affectedHost) {
|
||||
if ($hostId = $this->affectedHost->get('id')) {
|
||||
$query->joinLeft(
|
||||
['hsb' => 'icinga_host_service_blacklist'],
|
||||
$this->db()->quoteInto('o.id = hsb.service_id AND hsb.host_id = ?', $hostId),
|
||||
$this->db()->quoteInto("$alias.id = hsb.service_id AND hsb.host_id = ?", $hostId),
|
||||
[]
|
||||
)->columns([
|
||||
'blacklisted' => "CASE WHEN hsb.service_id IS NULL THEN 'n' ELSE 'y' END"
|
||||
|
|
|
|||
Loading…
Reference in a new issue