mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-26 00:54:27 +00:00
creating the api endpoint that fetches the content of the news instead of text metdata
This commit is contained in:
@@ -19,14 +19,23 @@ class News_model extends DB_Model
|
||||
*/
|
||||
public function getAll($limit = null)
|
||||
{
|
||||
$this->addJoin("campus.tbl_content","content_id");
|
||||
return $this->loadWhere('
|
||||
text IS NOT NULL
|
||||
AND datum <= NOW() AND (datum_bis IS NULL OR datum_bis >= now()::date)
|
||||
text IS NOT NULL
|
||||
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));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user