diff --git a/application/models/crm/Prestudentstatus_model.php b/application/models/crm/Prestudentstatus_model.php index 3335de021..f39a41fda 100644 --- a/application/models/crm/Prestudentstatus_model.php +++ b/application/models/crm/Prestudentstatus_model.php @@ -52,6 +52,24 @@ class Prestudentstatus_model extends DB_Model return $this->execQuery($query, $parametersArray); } + /** + * Liefert den Ersten Status eines Prestudenten mit der übergebenen Statuskurzbezeichnung. + * + * @param $prestudent_id + * @param $status_kurzbz + * @return array + */ + public function getFirstStatus($prestudent_id, $status_kurzbz) + { + $this->addOrder('datum, insertamum, ext_id'); + $this->addLimit(1); + + return $this->loadWhere(array( + 'prestudent_id' => $prestudent_id, + 'status_kurzbz' => $status_kurzbz + )); + } + /** * updateStufe */