aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Comments/Manager.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Comments/Manager.php')
-rw-r--r--lib/private/Comments/Manager.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php
index 2e9acb6ca24..410fcf26f4d 100644
--- a/lib/private/Comments/Manager.php
+++ b/lib/private/Comments/Manager.php
@@ -1210,20 +1210,21 @@ class Manager implements ICommentsManager {
$totalQuery->expr()->literal('":'),
$totalQuery->func()->count('id')
),
- 'total'
+ 'colonseparatedvalue'
)
+ ->selectAlias($totalQuery->func()->count('id'), 'total')
->from('reactions', 'r')
->where($totalQuery->expr()->eq('r.parent_id', $qb->createNamedParameter($parentId)))
->groupBy('r.reaction')
- ->orderBy($totalQuery->func()->count('id'), 'DESC')
+ ->orderBy('total', 'DESC')
->setMaxResults(200);
$jsonQuery = $this->dbConn->getQueryBuilder();
$jsonQuery
->selectAlias(
- $totalQuery->func()->concat(
+ $jsonQuery->func()->concat(
$jsonQuery->expr()->literal('{'),
- $jsonQuery->func()->groupConcat('total'),
+ $jsonQuery->func()->groupConcat('colonseparatedvalue', ',', $jsonQuery->getColumnName('total') . ' DESC'),
$jsonQuery->expr()->literal('}')
),
'json'