mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 02:12:17 +00:00
Merge branch 'feature-40309/Cis_News_widget' into feature-25999/C4
This commit is contained in:
@@ -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]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user