IcingaHostTable: order related objects for pgsql
This commit is contained in:
parent
a8768c7741
commit
a9c63cf325
|
@ -13,10 +13,11 @@ class IcingaHostTable extends IcingaObjectTable
|
||||||
|
|
||||||
public function getColumns()
|
public function getColumns()
|
||||||
{
|
{
|
||||||
if ($this->connection()->getDbType() === 'pgsql')
|
if ($this->connection()->getDbType() === 'pgsql') {
|
||||||
$parents = "ARRAY_TO_STRING(ARRAY_AGG(ih.object_name), ', ')";
|
$parents = "ARRAY_TO_STRING(ARRAY_AGG(ih.object_name ORDER BY hi.weight), ', ')";
|
||||||
else
|
} else {
|
||||||
$parents = "GROUP_CONCAT(ih.object_name ORDER BY hi.weight SEPARATOR ', ')";
|
$parents = "GROUP_CONCAT(ih.object_name ORDER BY hi.weight SEPARATOR ', ')";
|
||||||
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'id' => 'h.id',
|
'id' => 'h.id',
|
||||||
|
@ -60,8 +61,9 @@ class IcingaHostTable extends IcingaObjectTable
|
||||||
array('ih' => 'icinga_host'),
|
array('ih' => 'icinga_host'),
|
||||||
'hi.parent_host_id = ih.id',
|
'hi.parent_host_id = ih.id',
|
||||||
array()
|
array()
|
||||||
)->group('h.id, z.object_name')
|
)->group('h.id')
|
||||||
->order('h.object_name');
|
->group('z.id')
|
||||||
|
->order('h.object_name');
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue