loadAllStudentUIDSForPersonID also aggregate stg_oes to all student_uids to find assistenzen to notify about happenings of those students; finalized notifyAssistenzAboutMissingEntschuldigungDokumente - for now just skip entschuldigungen from persons with no active student linked anymore;

This commit is contained in:
Johann Hoffmann
2026-02-26 14:40:34 +01:00
parent 66e8408c3b
commit 29fdf9e0ba
+3 -2
View File
@@ -425,11 +425,12 @@ class Person_model extends DB_Model
$qry = "SELECT
CONCAT(tp.vorname, ' ', tp.nachname) AS name,
ARRAY_AGG(DISTINCT b.uid ORDER BY b.uid) AS uids,
ARRAY_AGG(DISTINCT s.studiengang_kz ORDER BY s.studiengang_kz) AS stg_kzs
ARRAY_AGG(DISTINCT CONCAT(stg.typ, stg.kurzbz)) AS stg_oes
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, s.semester, s.studiengang_kz
JOIN public.tbl_studiengang stg ON s.studiengang_kz = stg.studiengang_kz
GROUP BY tp.vorname, tp.nachname, b.aktiv, b.person_id, s.semester
HAVING b.person_id = ? AND b.aktiv IS TRUE AND s.semester > 0;";
return $this->execReadOnlyQuery($qry, [$person_id]);