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 <hainberg@technikum-wien.at>
This commit is contained in:
cris-technikum
2021-06-21 15:50:27 +02:00
parent 179299443b
commit 46edad620a
@@ -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