mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Added method getLastStatus()
This method gets the latest Vertragsstatus for the given Vertrag and Mitarbeiter.
This commit is contained in:
@@ -200,6 +200,29 @@ class Vertrag_model extends DB_Model
|
||||
return $this->execQuery($query, array($vertragsstatus_kurzbz, $vertrag_id, $mitarbeiter_uid, 'NOW()', getAuthUID(), null, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the latest Vertragsstatus for the given Vertrag and Mitarbeiter
|
||||
* @param integer $vertrag_id
|
||||
* @param string $mitarbeiter_uid
|
||||
* @return array
|
||||
*/
|
||||
public function getLastStatus($vertrag_id, $mitarbeiter_uid)
|
||||
{
|
||||
$this->addSelect('vertragsstatus_kurzbz');
|
||||
$this->addJoin('lehre.tbl_vertrag_vertragsstatus', 'vertrag_id');
|
||||
$this->addOrder('datum', 'DESC');
|
||||
$this->addLimit(1);
|
||||
return $this->loadWhere(
|
||||
array(
|
||||
'vertrag_id' => $vertrag_id,
|
||||
'uid' => $mitarbeiter_uid
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Generate contract description.
|
||||
* Example: WS2017-BEE3-LIA-LAB
|
||||
|
||||
Reference in New Issue
Block a user