mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
PersonModel loadAllStudentUIDSForPersonID used in anw extension AdministrationApi aka Entschuldigungsmanagement
This commit is contained in:
@@ -420,4 +420,17 @@ class Person_model extends DB_Model
|
||||
return success($result);
|
||||
}
|
||||
}
|
||||
|
||||
public function loadAllStudentUIDSForPersonID($person_id) {
|
||||
$qry = "SELECT
|
||||
CONCAT(tp.vorname, ' ', tp.nachname) AS name,
|
||||
ARRAY_AGG(DISTINCT b.uid ORDER BY b.uid) AS uids
|
||||
FROM public.tbl_student s
|
||||
JOIN public.tbl_benutzer b ON s.student_uid = b.uid
|
||||
JOIN public.tbl_person tp ON b.person_id = tp.person_id
|
||||
GROUP BY tp.vorname, tp.nachname, b.aktiv, b.person_id
|
||||
HAVING b.person_id = ? AND b.aktiv IS TRUE;";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, [$person_id]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user