diff --git a/lib/models/Course.class.php b/lib/models/Course.class.php index 4500daa59e8e18ac6fe4651a6536f43ca364aaff..d9325b099bebf46e66087629def69a4c2a656e35 100644 --- a/lib/models/Course.class.php +++ b/lib/models/Course.class.php @@ -935,7 +935,7 @@ class Course extends SimpleORMap implements Range, PrivacyObject, StudipItem, Fe * @param bool $with_deputies Whether to include courses where the user is * a deputy (true) or not (false). Defaults to true. * - * @returns Course[] A list of courses. + * @return Course[] A list of courses. */ public static function findByUser($user_id, $perms = [], $with_deputies = true) { @@ -960,6 +960,7 @@ class Course extends SimpleORMap implements Range, PrivacyObject, StudipItem, Fe return Course::findBySQL( "LEFT JOIN semester_courses ON (semester_courses.course_id = seminare.Seminar_id) WHERE Seminar_id IN (?) + GROUP BY seminare.Seminar_id ORDER BY IF(semester_courses.semester_id IS NULL, 1, 0) DESC, start_time DESC, Name ASC", [$seminar_ids] );