filter_to_sql: properly set query limit by date

This commit is contained in:
Andrew Dolgov 2011-04-21 18:27:44 +04:00
parent d206ae1d6a
commit 6b8b3af87e

View file

@ -7348,13 +7348,14 @@
if ($query) {
if (DB_TYPE == "pgsql") {
$query .= " AND ttrss_entries.date_entered > NOW() - INTERVAL '30 days'";
$query = " ($query) AND ttrss_entries.date_entered > NOW() - INTERVAL '14 days'";
} else {
$query .= " AND ttrss_entries.date_entered > DATE_SUB(NOW(), INTERVAL 30 DAY";
$query = " ($query) AND ttrss_entries.date_entered > DATE_SUB(NOW(), INTERVAL 14 DAY";
}
$query .= " AND ";
}
return $query;
}