fix: [sighting] Order must contain group for some mysql servers

pull/6835/head
Jakub Onderka 2020-12-21 18:38:59 +01:00 committed by iglocska
parent ea391232a8
commit 1276a42309
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 2 additions and 2 deletions

View File

@ -332,7 +332,7 @@ class Sighting extends AppModel
'fields' => ['org_id', 'attribute_id', 'type', 'date', 'last_timestamp', 'sighting_count'],
'recursive' => -1,
'group' => ['org_id', 'attribute_id', 'type', 'date'],
'order' => ['date_sighting'], // from oldest
'order' => ['date'], // from oldest
));
unset(
$this->virtualFields['date'],
@ -369,7 +369,7 @@ class Sighting extends AppModel
'conditions' => $conditions,
'fields' => [ucfirst($context) . 'Tag.tag_id', 'date', 'sighting_count'],
'group' => [ucfirst($context) . 'Tag.id', 'date'],
'order' => ['date_sighting'], // from oldest
'order' => ['date'], // from oldest
]);
unset($this->virtualFields['date'], $this->virtualFields['sighting_count']);
return $sightings;