Merge branch 'feature-40309/Cis_News_widget' into feature-25999/C4

This commit is contained in:
Harald Bamberger
2024-09-09 13:03:47 +02:00
35 changed files with 975 additions and 338 deletions
+16 -3
View File
@@ -19,14 +19,27 @@ class News_model extends DB_Model
*/
public function getAll($limit = null)
{
return $this->loadWhere('
text IS NOT NULL
AND datum <= NOW() AND (datum_bis IS NULL OR datum_bis >= now()::date)
$this->addJoin("campus.tbl_content","content_id");
return $this->execReadOnlyQuery('
SELECT *
FROM campus.tbl_news
JOIN campus.tbl_content content ON content.content_id = campus.tbl_news.content_id
WHERE
--text IS NOT NULL AND
datum <= NOW() AND (datum_bis IS NULL OR datum_bis >= now()::date)
ORDER BY datum DESC
LIMIT ' . $this->escape($limit)
);
}
public function getNewsContentIDs($limit=10){
$this->addSelect(['content_id']);
return $this->loadWhere("datum <= NOW() AND (datum_bis IS NULL OR datum_bis >= now()::date)
ORDER BY datum DESC
LIMIT " . $this->escape($limit));
}
/**
@@ -20,4 +20,16 @@ class Ort_model extends DB_Model
return $this->OrtModel->loadWhere(array("raumtyp_kurzbz" => $raumtyp_kurzbz));
}
public function getContentID($ort_kurzbz)
{
return $this->execReadOnlyQuery("
SELECT content_id
FROM public.tbl_ort
WHERE ort_kurzbz = ?;
",[$ort_kurzbz]);
}
}