Merge branch 'fronkdev' into 'master'

Added Cron script for MaintenanceNotification emails

See merge request fronk/thetool!744
This commit is contained in:
Frank Schubert
2024-11-14 20:08:53 +00:00

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)";
}
}