mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
Messaging system: student writes new message: separate logic for master and bachelor
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user