fix: [dashboard:widgets] Reverted `only_full_group_by` fix as it returns incorrect data

Will need to fix this later on
pull/9250/head
Sami Mokaddem 2023-08-11 08:09:19 +02:00
parent 3c097f8202
commit 22e863fac3
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
3 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ class EventEvolutionLineWidget
'recursive' => -1,
'conditions' => $eparams['conditions'],
'fields' => ['DATE_FORMAT(FROM_UNIXTIME(Event.publish_timestamp), "%Y-%m") AS date', 'count(id) AS count'],
'group' => ['MONTH(FROM_UNIXTIME(Event.publish_timestamp)), YEAR(FROM_UNIXTIME(Event.publish_timestamp))', 'Event.publish_timestamp',]
'group' => ['MONTH(FROM_UNIXTIME(Event.publish_timestamp)), YEAR(FROM_UNIXTIME(Event.publish_timestamp))',]
]);

View File

@ -83,7 +83,7 @@ class OrgEvolutionLineWidget
'recursive' => -1,
'conditions' => $params['conditions'],
'fields' => ['DATE_FORMAT(date_created, "%Y-%m") AS date', 'count(id) AS count'],
'group' => ['MONTH(date_created), YEAR(date_created)', 'Organisation.date_created', ]
'group' => ['MONTH(date_created), YEAR(date_created)', ]
]);
usort($raw, [$this, 'sortByCreationDate']);

View File

@ -99,7 +99,7 @@ class TrendingAttributesWidget
$values = $attributeModel->find('all', [
'recursive' => -1,
'fields' => ['Attribute.value1', 'count(Attribute.value1) as Attribute__frequency'],
'group' => ['Attribute.value1', 'Event.orgc_id', 'Event.id',], // Multiple group for `only_full_group_by`
'group' => ['Attribute.value1', ],
'conditions' => $conditions,
'contain' => ['Event.orgc_id'],
'order' => 'count(Attribute.value1) desc',