From f7bd49b408cea514c491695ed9404080f1fd66fb Mon Sep 17 00:00:00 2001 From: ma0048 Date: Fri, 28 Oct 2022 10:56:02 +0200 Subject: [PATCH] - master messages an studiengang, wenn bereits bestaetigt - lehrgang messages direkt an lehrgang --- application/models/CL/Messages_model.php | 4 ++-- application/models/crm/Prestudent_model.php | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/application/models/CL/Messages_model.php b/application/models/CL/Messages_model.php index b987102dd..04192a7b4 100644 --- a/application/models/CL/Messages_model.php +++ b/application/models/CL/Messages_model.php @@ -128,8 +128,8 @@ class Messages_model extends CI_Model { $ouOptions .= sprintf( "\n".'', - is_numeric($ou->prestudent_id) ? $ou->oe_kurzbz : self::ALT_OE, - $ou->bezeichnung . (is_numeric($ou->prestudent_id) ? '' : ' *') + ($ou->typ === 'l' ? $ou->oe_kurzbz : (is_numeric($ou->prestudent_id) ? $ou->oe_kurzbz : self::ALT_OE)), + $ou->bezeichnung . ((is_numeric($ou->prestudent_id) || $ou->typ === 'l' ) ? '' : ' *') ); } } diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index f37b715f4..9addfcc95 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -560,9 +560,10 @@ class Prestudent_model extends DB_Model o.bezeichnung, (CASE WHEN sg.typ = \'b\' THEN ps.prestudent_id - WHEN sg.typ = \'m\' THEN ps.prestudent_id + WHEN sg.typ = \'m\' THEN mps.prestudent_id ELSE NULL - END) AS prestudent_id + END) AS prestudent_id, + sg.typ FROM public.tbl_prestudent p JOIN public.tbl_studiengang sg USING(studiengang_kz) JOIN public.tbl_organisationseinheit o USING(oe_kurzbz) @@ -571,11 +572,17 @@ class Prestudent_model extends DB_Model FROM public.tbl_prestudentstatus WHERE status_kurzbz = \'Bewerber\' ) ps USING(prestudent_id) + LEFT JOIN ( + SELECT prestudent_id + FROM public.tbl_prestudentstatus + WHERE status_kurzbz = \'Interessent\' AND bestaetigtam IS NOT NULL + ) mps ON p.prestudent_id = mps.prestudent_id WHERE p.person_id = ? GROUP BY o.oe_kurzbz, o.bezeichnung, sg.typ, ps.prestudent_id, + mps.prestudent_id, p.prestudent_id ORDER BY o.bezeichnung';