mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 17:32:18 +00:00
legacy raumsuche.php -> cis4 vue component
This commit is contained in:
@@ -11,4 +11,19 @@ class Stunde_model extends DB_Model
|
||||
$this->dbTable = 'lehre.tbl_stunde';
|
||||
$this->pk = 'stunde';
|
||||
}
|
||||
|
||||
/**
|
||||
* $time needs to be of PGSQL TIME format
|
||||
*/
|
||||
public function getStundeForTime($time) {
|
||||
$query = "
|
||||
SELECT min(stunde) as stunde FROM (
|
||||
SELECT stunde, extract(epoch from (beginn-?)) AS delta FROM lehre.tbl_stunde
|
||||
UNION
|
||||
SELECT stunde, extract(epoch from (ende-?)) AS delta FROM lehre.tbl_stunde
|
||||
) foo WHERE delta>=0
|
||||
";
|
||||
|
||||
return $this->execReadOnlyQuery($query, [$time, $time]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user