0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00

fix sql for notification resend; see #226

This commit is contained in:
David Goodwin 2018-12-30 18:16:31 +00:00 committed by David Goodwin
parent 9d31639eef
commit bdbce9ebe5

View File

@ -286,7 +286,7 @@ sub already_notified {
if ($db_type eq 'Pg') {
$query = qq{SELECT extract( epoch from (NOW()-notified_at))::int FROM vacation_notification WHERE on_vacation=? AND notified=?};
} else { # mysql
$query = qq{SELECT NOW()-notified_at FROM vacation_notification WHERE on_vacation=? AND notified=?};
$query = qq{SELECT UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(notified_at) FROM vacation_notification WHERE on_vacation=? AND notified=?};
}
$stm = $dbh->prepare($query) or panic_prepare($query);
$stm->execute($to,$from) or panic_execute($query,"on_vacation='$to', notified='$from'");