From f4376d44a2a25eba896588a14a9630af44541e3d Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Thu, 18 Jul 2024 13:40:52 +0200 Subject: [PATCH] Fix Bugs in Bismeldestichtag_model checkIfMeldestichtagErreicht --- application/models/codex/Bismeldestichtag_model.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/application/models/codex/Bismeldestichtag_model.php b/application/models/codex/Bismeldestichtag_model.php index df9e53920..319aa7be7 100644 --- a/application/models/codex/Bismeldestichtag_model.php +++ b/application/models/codex/Bismeldestichtag_model.php @@ -54,19 +54,18 @@ class Bismeldestichtag_model extends DB_Model ); if(isError($result)) { - $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); - return $this->outputJson(getError($result)); + return $result; } $result = current(getData($result)); - $studiensemester_ende = $result->ende; + $studiensemester_ende = new DateTime($result->ende); } // letztes erreichtes Bismeldedatum holen $result = $this->getLastReachedMeldestichtag(); if (isError($result)) { - return error($result); + return $result; } if (!hasData($result)) { return success("0",'No Statusdata vorhanden'); @@ -88,7 +87,7 @@ class Bismeldestichtag_model extends DB_Model $erreicht = $erreicht || $studiensemester_ende < $stichtag; } - if($erreicht) + if ($erreicht) return success("1", "Studentstatus mit Datum oder Semesterende vor erreichtem Meldestichtag können nicht hinzugefügt werden"); return success("0", "Meldestatus nicht erreicht");