From 10ed780b6c76847b9d2bf0f928669591d8cc40eb Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 6 Dec 2022 10:50:08 +0100 Subject: [PATCH] Added method getFachbereichsleitungByLv to Lehrveranstaltung_model Gets all fachbereichsleiter of a Lehrveranstaltung --- .../education/Lehrveranstaltung_model.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index f54443955..b0c7d23a6 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -200,6 +200,29 @@ class Lehrveranstaltung_model extends DB_Model return $this->execQuery($query, array($lehrveranstaltung_id, $studiensemester_kurzbz)); } + /** + * Gets all fachbereichsleiter of a Lehrveranstaltung + * @param $lehrveranstaltung_id + * @return array|null + */ + public function getFachbereichByLv($lehrveranstaltung_id) + { + $query = "select distinct vorname, nachname, uid, true as lvleiter + FROM + lehre.tbl_lehrveranstaltung lv + JOIN public.tbl_organisationseinheit og using (oe_kurzbz) + JOIN public.tbl_benutzerfunktion bf using (oe_kurzbz) + join public.tbl_benutzer b using (uid) + join public.tbl_person p using (person_id) + where + bf.datum_von <= now()::date + and (bf.datum_bis >= now()::date or bf.datum_bis is null) + and bf.funktion_kurzbz = 'Leitung' + AND og.organisationseinheittyp_kurzbz = 'Fachbereich' + and lehrveranstaltung_id = ?"; + + return $this->execQuery($query, array($lehrveranstaltung_id)); + } /** * Gets Lehrveranstaltungen of a student