filter_to_sql: limit results to last 30 days of articles

This commit is contained in:
Andrew Dolgov 2011-04-18 20:01:25 +04:00
parent da497babda
commit 6338b16fb5
1 changed files with 7 additions and 1 deletions

View File

@ -7301,8 +7301,14 @@
if ($filter["inverse"]) if ($filter["inverse"])
$query = "NOT ($query)"; $query = "NOT ($query)";
if ($query) if ($query) {
if (DB_TYPE == "pgsql") {
$query .= " AND ttrss_entries.date_entered > NOW() - INTERVAL '30 days'";
} else {
$query .= " AND ttrss_entries.date_entered > DATE_SUB(NOW(), INTERVAL 30 DAY";
}
$query .= " AND "; $query .= " AND ";
}
return $query; return $query;
} }