code quality

This commit is contained in:
cgfhtw
2023-03-10 10:29:54 +01:00
parent 4120f5a566
commit 83c0413815
14 changed files with 135 additions and 146 deletions
+13 -14
View File
@@ -12,18 +12,17 @@ class News_model extends DB_Model
$this->pk = 'news_id';
}
/**
* Get all News ordered by date. (most actual on top)
* @param null $limit Amount of news.
* @return array
*/
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)
ORDER BY datum DESC
LIMIT '. $this->escape($limit)
);
}
/**
* Get all News ordered by date. (most actual on top)
* @param null $limit Amount of news.
* @return array
*/
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)
ORDER BY datum DESC
LIMIT '. $this->escape($limit));
}
}