mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-07 15:19:31 +00:00
37 lines
791 B
PHP
37 lines
791 B
PHP
<?php
|
|
class Benutzer_model extends DB_Model
|
|
{
|
|
|
|
/**
|
|
* Constructor
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->dbTable = 'public.tbl_benutzer';
|
|
$this->pk = array('uid');
|
|
$this->hasSequence = false;
|
|
}
|
|
|
|
public function getFromPersonId($person_id)
|
|
{
|
|
return $this->loadWhere(array('person_id' => $person_id, 'aktiv' => true));
|
|
}
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public function getActiveUserByPersonIdAndOrganisationUnit($person_id, $oe_kurzbz)
|
|
{
|
|
$sql = 'SELECT b.uid
|
|
FROM public.tbl_benutzer b
|
|
JOIN public.tbl_prestudent ps USING (person_id)
|
|
JOIN public.tbl_studiengang sg USING (studiengang_kz)
|
|
WHERE ps.person_id = ?
|
|
AND sg.oe_kurzbz = ?
|
|
AND b.aktiv = TRUE';
|
|
|
|
return $this->execQuery($sql, array($person_id, $oe_kurzbz));
|
|
}
|
|
}
|