legacy raumsuche.php -> cis4 vue component

This commit is contained in:
Johann Hoffmann
2025-02-28 16:41:18 +01:00
parent 4a01198e10
commit bc7dba1c14
10 changed files with 447 additions and 4 deletions
@@ -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]);
}
}