[DATABASE] Use time intervals in a SQL standard compliant way

This commit is contained in:
Alexei Sorokin
2019-09-11 09:58:13 +03:00
committed by Diogo Peralta Cordeiro
parent 6095a6de64
commit 60ada8ae65
4 changed files with 39 additions and 23 deletions

View File

@@ -366,7 +366,7 @@ class FeedSub extends Managed_DataObject
public static function renewalCheck()
{
$fs = new FeedSub();
$fs->whereAdd('sub_end IS NOT NULL AND sub_end < (CURRENT_TIMESTAMP + INTERVAL 1 DAY)');
$fs->whereAdd("sub_end IS NOT NULL AND sub_end < (CURRENT_TIMESTAMP + INTERVAL '1' DAY)");
// find can be both false and 0, depending on why nothing was found
if (!$fs->find()) {
throw new NoResultException($fs);