Added method getSTGLByUID(uid) to Benutzerfunktion_model

The method getSTGLByUID(uid) gets information of all STG of which a given
user is in charge of as a study course manager.
This commit is contained in:
Cris
2019-08-01 15:38:33 +02:00
committed by hainberg
parent 2daef49e52
commit a81098f884
@@ -104,4 +104,38 @@ class Benutzerfunktion_model extends DB_Model
return $this->execQuery($query, $parametersArray);
}
/**
* Get active Studiengangsleitung(en) of the user by UID.
* @param $uid
*/
public function getSTGLByUID($uid)
{
$query = '
SELECT
uid,
oe_kurzbz,
studiengang_kz,
typ,
tbl_studiengang.bezeichnung
FROM
public.tbl_benutzerfunktion
JOIN public.tbl_studiengang USING (oe_kurzbz)
WHERE
funktion_kurzbz = \'Leitung\'
AND (datum_von IS NULL OR datum_von <= now())
AND (datum_bis IS NULL OR datum_bis >= now())
AND uid = ?
ORDER BY
oe_kurzbz
';
$parameters_array = array();
if (is_string($uid))
{
$parameters_array[] = $uid;
}
return $this->execQuery($query, $parameters_array);
}
}