uses the new fhcApi factory to make the roomInformation get request from the frontent/v1/stundenplan api and uses the CalendarDate class to get the first day of the week and the last day of the week to make the request for the room information over the whole week

This commit is contained in:
SimonGschnell
2024-06-04 08:24:58 +02:00
parent 39321dcde3
commit 3df1aaf371
7 changed files with 132 additions and 53 deletions
@@ -18,7 +18,7 @@ class Stundenplan_model extends DB_Model
*
* @return stdClass
*/
public function getRoomDataOnDay($ort_kurzbz,$date){
public function getRoomDataOnDay($ort_kurzbz='EDV_A2.06',$start_date='2024-05-21',$end_date='2024-05-21'){
$this->addSelect(['*',"CONCAT(UPPER(sp.stg_typ),UPPER(sp.stg_kurzbz),'-',COALESCE(CAST(sp.semester AS varchar),'/'),COALESCE(CAST(sp.verband AS varchar),'/')) as stg","lektor","CONCAT(lehrfach,'-',lehrform) as lv_info" ]);
@@ -28,12 +28,13 @@ class Stundenplan_model extends DB_Model
$res = $this->loadWhere(['ort_kurzbz'=>$ort_kurzbz,'datum'=>$date]);
$res = hasData($res) ? getData($res): null;
return $res; */
$this->db->where('ort_kurzbz','EDV_A2.06',true);
$this->db->where('datum >=','2024-05-21',true);
$this->db->where('ort_kurzbz',$ort_kurzbz,true);
$this->db->where('datum >=',$start_date,true);
$this->db->where('datum <=',$end_date,true);
$query = $this->db->get_compiled_select('lehre.vw_stundenplan sp');
return $this->execQuery($query, [$ort_kurzbz, $date]);
return $this->execQuery($query, [$ort_kurzbz, $start_date, $end_date]);
}
/**