From ee7d51d2b361acccbdfdd3bb060fa20b31b78794 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Mon, 15 Mar 2021 23:27:28 +0100 Subject: [PATCH] =?UTF-8?q?Pruefung=5Fmodel.php:=20method=20for=20retrievi?= =?UTF-8?q?ng=20Pr=C3=BCfung=20by=20person=20and=20studiensemester?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/education/Pruefung_model.php | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/application/models/education/Pruefung_model.php b/application/models/education/Pruefung_model.php index d10364979..e3776c4ad 100644 --- a/application/models/education/Pruefung_model.php +++ b/application/models/education/Pruefung_model.php @@ -11,4 +11,29 @@ class Pruefung_model extends DB_Model $this->dbTable = 'campus.tbl_pruefung'; $this->pk = 'pruefung_id'; } + + /** + * Gets Pruefungen of a person for a Studiensemester. + * @param int $person_id + * @param string $studiensemester_kurzbz + * @return object + */ + public function getByPerson($person_id, $studiensemester_kurzbz) + { + $qry = ' + SELECT prfg.*, pers.matr_nr, lv.ects, stg.studiengang_kz, prst.prestudent_id, + UPPER(stg.typ||stg.kurzbz) AS studiengang, stg.bezeichnung AS studiengang_bezeichnung + FROM public.tbl_person pers + JOIN public.tbl_prestudent prst USING (person_id) + JOIN public.tbl_student USING (prestudent_id) + JOIN lehre.tbl_pruefung prfg USING (student_uid) + JOIN lehre.tbl_lehreinheit le USING (lehreinheit_id) + JOIN lehre.tbl_lehrveranstaltung lv USING (lehrveranstaltung_id) + JOIN public.tbl_studiengang stg ON prst.studiengang_kz = stg.studiengang_kz + WHERE pers.person_id = ? + AND le.studiensemester_kurzbz = ? + ORDER BY prfg.datum, pruefung_id'; + + return $this->execQuery($qry, array($person_id, $studiensemester_kurzbz)); + } }