Fix older/newer than filter on accounts search API method
This commit is contained in:
parent
fac4cca53a
commit
ebe97d05f7
|
@ -90,13 +90,15 @@ switch ($user_filter) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (isset($_GET['older_than_days']))
|
||||
$sql_all = str_replace('{olderThanNDays}', "(acs.updated_at IS NULL OR acs.updated_at <= (NOW() - INTERVAL '".intval($_GET['older_than_days'])." days')) AND", $sql_all);
|
||||
else $sql_all = str_replace('{olderThanNDays}', '', $sql_all);
|
||||
if (isset($_GET['older_than_days'])) {
|
||||
$_str_interval = "(NOW() - INTERVAL '".intval($_GET['older_than_days'])." days')";
|
||||
$sql_all = str_replace('{olderThanNDays}', "a.created_at <= $_str_interval AND (acs.updated_at IS NULL OR acs.updated_at <= $_str_interval) AND", $sql_all);
|
||||
} else $sql_all = str_replace('{olderThanNDays}', '', $sql_all);
|
||||
|
||||
if (isset($_GET['newer_than_days']))
|
||||
$sql_all = str_replace('{newerThanNDays}', "(NOT acs.updated_at IS NULL AND acs.updated_at >= (NOW() - INTERVAL '".intval($_GET['newer_than_days'])." days')) AND", $sql_all);
|
||||
else $sql_all = str_replace('{newerThanNDays}', '', $sql_all);
|
||||
if (isset($_GET['newer_than_days'])) {
|
||||
$_str_interval = "(NOW() - INTERVAL '".intval($_GET['newer_than_days'])." days')";
|
||||
$sql_all = str_replace('{newerThanNDays}', "a.created_at >= $_str_interval AND (acs.updated_at IS NULL OR acs.updated_at >= $_str_interval) AND", $sql_all);
|
||||
} else $sql_all = str_replace('{newerThanNDays}', '', $sql_all);
|
||||
|
||||
if (isset($_GET['no_avatar']))
|
||||
$sql_all = str_replace('{noAvatarWhere}', 'a.avatar_file_name IS NULL AND', $sql_all);
|
||||
|
|
Loading…
Reference in New Issue