Skip to content

Commit

Permalink
sort on query
Browse files Browse the repository at this point in the history
  • Loading branch information
vetemi committed Oct 9, 2018
1 parent 9048827 commit e7f2dc8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions backend/src/Controller/ActivitiesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,6 @@ private function prepareResult($result, $excludePast = false)
if ($excludePast) {
$this->excludePast($activity);
}

usort($activity->schedules, function ($schedule1, $schedule2) {
return strtotime($schedule1->start_date) - strtotime($schedule2->start_date);
});
}
}

Expand All @@ -297,7 +293,9 @@ protected function baseContain()
'Tags',
'Categories',
'TargetGroups',
'Schedules',
'Schedules' => [
'sort' => ['Schedules.start_date' => 'ASC']
],
'Providers.Organisations'
];
}
Expand Down

0 comments on commit e7f2dc8

Please sign in to comment.