Messaging system: student writes new message: separate logic for master and bachelor

This commit is contained in:
Paolo
2020-02-04 17:02:25 +01:00
parent 53ac4d11ba
commit 749e9be64d
+9 -5
View File
@@ -524,26 +524,30 @@ class Prestudent_model extends DB_Model
/**
* Get organisation units for all the prestudents of a person
* TODO
*/
public function getOrganisationunitsByPersonId($person_id)
{
$query = 'SELECT o.oe_kurzbz,
o.bezeichnung,
ps.prestudent_id
(CASE
WHEN sg.typ = \'b\' THEN ps.prestudent_id
WHEN sg.typ = \'m\' THEN p.prestudent_id
ELSE NULL
END) AS prestudent_id
FROM public.tbl_prestudent p
JOIN public.tbl_studiengang sg USING(studiengang_kz)
JOIN public.tbl_organisationseinheit o USING(oe_kurzbz)
LEFT JOIN (
SELECT prestudent_id
FROM public.tbl_prestudentstatus
WHERE bestaetigtam IS NOT NULL
AND status_kurzbz = \'Interessent\'
WHERE status_kurzbz = \'Bewerber\'
) ps USING(prestudent_id)
WHERE p.person_id = ?
GROUP BY o.oe_kurzbz,
o.bezeichnung,
ps.prestudent_id
sg.typ,
ps.prestudent_id,
p.prestudent_id
ORDER BY o.bezeichnung';
return $this->execQuery($query, array($person_id));