mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 01:42:17 +00:00
api & anpassungen fuer das kartenterminal
This commit is contained in:
@@ -68,4 +68,27 @@ class Konto_model extends DB_Model
|
||||
return error('Failed to load Payment');
|
||||
}
|
||||
}
|
||||
|
||||
public function getLastStudienbeitrag($uid, $buchungstypen)
|
||||
{
|
||||
$query = 'SELECT konto.studiensemester_kurzbz
|
||||
FROM public.tbl_konto konto,
|
||||
public.tbl_benutzer,
|
||||
public.tbl_student
|
||||
WHERE tbl_benutzer.uid = \'' . $uid . '\'
|
||||
AND tbl_benutzer.uid = tbl_student.student_uid
|
||||
AND tbl_benutzer.person_id = konto.person_id
|
||||
AND konto.studiengang_kz = tbl_student.studiengang_kz
|
||||
AND konto.buchungstyp_kurzbz IN (\'' . $buchungstypen . '\')
|
||||
AND 0 = (
|
||||
SELECT sum(betrag)
|
||||
FROM public.tbl_konto skonto
|
||||
WHERE skonto.buchungsnr = konto.buchungsnr_verweis
|
||||
OR skonto.buchungsnr_verweis = konto.buchungsnr_verweis
|
||||
)
|
||||
ORDER BY buchungsnr DESC LIMIT 1;
|
||||
';
|
||||
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
class Fotostatusperson_model extends DB_Model
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_person_fotostatus';
|
||||
$this->pk = 'person_fotostatus_id';
|
||||
}
|
||||
|
||||
public function getLastFotoStatus($person_id)
|
||||
{
|
||||
$this->addOrder('datum', 'DESC');
|
||||
$this->addOrder('person_fotostatus_id', 'DESC');
|
||||
$this->addLimit(1);
|
||||
|
||||
return $this->loadWhere(array('person_id' => $person_id));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -193,7 +193,7 @@ class Person_model extends DB_Model
|
||||
*/
|
||||
public function getByUid($uid)
|
||||
{
|
||||
$this->addSelect('vorname, nachname, gebdatum, person_id, bpk, matr_nr');
|
||||
$this->addSelect('vorname, nachname, gebdatum, person_id, bpk, matr_nr, foto');
|
||||
$this->addJoin('tbl_benutzer', 'person_id');
|
||||
|
||||
return $this->loadWhere(array('uid' => $uid));
|
||||
|
||||
@@ -55,4 +55,21 @@ class Betriebsmittelperson_model extends DB_Model
|
||||
|
||||
return $this->loadWhere($condition);
|
||||
}
|
||||
|
||||
public function getBetriebsmittelZuordnung($cardIdentifier, $typ = 'Zutrittskarte', $ausgegeben = true)
|
||||
{
|
||||
$this->addJoin('wawi.tbl_betriebsmittel', 'betriebsmittel_id');
|
||||
|
||||
$where = 'wawi.tbl_betriebsmittel.nummer2 = \'' . $cardIdentifier . '\'
|
||||
AND wawi.tbl_betriebsmittel.betriebsmitteltyp = \''. $typ .'\'
|
||||
AND (retouram >= now() OR retouram IS NULL)
|
||||
';
|
||||
|
||||
if ($ausgegeben)
|
||||
$where .= 'AND ausgegebenam <= now()';
|
||||
else
|
||||
$where .= 'AND (ausgegebenam <= now() OR ausgegebenam IS NULL)';
|
||||
|
||||
return $this->loadWhere($where);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -309,7 +309,9 @@
|
||||
"scottjehl/Respond": "1.4.2",
|
||||
|
||||
"tapmodo/Jcrop": "2.0.4",
|
||||
"tomazdragar/SimpleCropper": "1.0"
|
||||
"tomazdragar/SimpleCropper": "1.0",
|
||||
|
||||
"chillerlan/php-qrcode": "2.0.*"
|
||||
},
|
||||
"config": {
|
||||
"bin-dir": "vendor/bin"
|
||||
|
||||
Reference in New Issue
Block a user