From 46edad620a44f2ac935ddc3581d2ded1e449a64e Mon Sep 17 00:00:00 2001 From: cris-technikum Date: Mon, 21 Jun 2021 15:50:27 +0200 Subject: [PATCH] Fixed: to NOT send Ablehnungsmail to students multiple times If STGL was rejecting - withdrawing multiple times and entering different reasons (notizen), the Ablehnungsmail was sent for each of that reasons. Now the mail is sent only once for most recent reason. Signed-off-by: cris-technikum --- application/controllers/jobs/AnrechnungJob.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/controllers/jobs/AnrechnungJob.php b/application/controllers/jobs/AnrechnungJob.php index 9f563cf19..09fe9a8af 100644 --- a/application/controllers/jobs/AnrechnungJob.php +++ b/application/controllers/jobs/AnrechnungJob.php @@ -290,6 +290,9 @@ class AnrechnungJob extends JOB_Controller $this->AnrechnungModel->addJoin('public.tbl_notizzuordnung', 'anrechnung_id'); $this->AnrechnungModel->addJoin('public.tbl_notiz notiz', 'notiz_id'); + $this->AnrechnungModel->addOrder('notiz.insertamum', 'DESC'); + $this->AnrechnungModel->addLimit(1); + $result = $this->AnrechnungModel->loadWhere( '(status.insertamum)::date = (NOW() - INTERVAL \'24 HOURS\')::DATE AND