mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-21 04:44:25 +02:00
Ido\StatusQuery: join ALL latest comment
And it was soooo fast :p refs #7057
This commit is contained in:
parent
d8e71d3790
commit
a58b2aac00
@ -515,9 +515,10 @@ class StatusQuery extends IdoQuery
|
|||||||
$sub = '(SELECT'
|
$sub = '(SELECT'
|
||||||
. ' c.object_id,'
|
. ' c.object_id,'
|
||||||
. " '[' || c.author_name || '] ' || c.comment_data AS $fieldName"
|
. " '[' || c.author_name || '] ' || c.comment_data AS $fieldName"
|
||||||
. ' FROM icinga_comments c'
|
. ' FROM icinga_comments c JOIN ('
|
||||||
. ' WHERE c.entry_type = ' . $entryType
|
. ' SELECT MAX(comment_id) AS comment_id, object_id FROM icinga_comments'
|
||||||
. ' ORDER BY c.comment_id DESC LIMIT 1)';
|
. ' WHERE entry_type = ' . $entryType . ' GROUP BY object_id'
|
||||||
|
. ' ) lc ON c.comment_id = lc.comment_id)';
|
||||||
|
|
||||||
return new Zend_Db_Expr($sub);
|
return new Zend_Db_Expr($sub);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user