From 24ce443e95d7265a7fcb56186f11cf30dca3f0b7 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 15 Oct 2024 17:40:11 +0200 Subject: [PATCH] nur die letzte komm oder zusaetzlichen komm Pruefung einer LV beruecksichtigen --- application/models/education/Pruefung_model.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/models/education/Pruefung_model.php b/application/models/education/Pruefung_model.php index 214d6519f..409c0b733 100644 --- a/application/models/education/Pruefung_model.php +++ b/application/models/education/Pruefung_model.php @@ -175,6 +175,8 @@ class Pruefung_model extends DB_Model $this->addSelect('campus.get_status_studierendenantrag(a.studierendenantrag_id) status'); $this->addSelect('pss.ausbildungssemester'); + $this->addJoin('(SELECT MAX(datum) AS datum, lehreinheit_id AS le_id, student_uid AS stud_uid FROM lehre.tbl_pruefung p WHERE pruefungstyp_kurzbz IN (\'kommPruef\', \'zusKommPruef\') GROUP BY lehreinheit_id, student_uid) lpd', + 'p.datum = lpd.datum AND p.lehreinheit_id = lpd.le_id AND p.student_uid = lpd.stud_uid'); $this->addJoin('lehre.tbl_lehreinheit le', 'lehreinheit_id'); $this->addJoin('lehre.tbl_lehrveranstaltung lv', 'lehrveranstaltung_id'); $this->addJoin('public.tbl_student s', 'student_uid');