Added Cron script for MaintenanceNotification emails

This commit is contained in:
Frank Schubert
2024-11-14 21:07:56 +01:00
parent 3f4b8b80c3
commit 10d1d8b6a8

View File

@@ -347,6 +347,7 @@ class MaintenanceNotification extends mfBaseModel {
public static function searchActive($filter, $limit = false, $order = false) {
$filter["to>"] = date("U");
$filter["sent"] = false;
return self::search($filter, $limit, $order);
}
@@ -409,7 +410,15 @@ class MaintenanceNotification extends mfBaseModel {
$where .= " AND MaintenanceNotification.to >= $to";
}
}
if(array_key_exists("sent", $filter)) {
$sent = $filter['sent'];
if($sent === true) {
$where .= " AND MaintenanceNotification.sent > 0";
} elseif($sent === false || $sent === null) {
$where .= " AND (MaintenanceNotification.sent IS NULL OR MaintenanceNotification.sent = 0)";
}
}