Fixed MaintenanceinfoApi
This commit is contained in:
@@ -15,7 +15,7 @@ class MaintenanceinfoApicontroller extends mfBaseApicontroller {
|
|||||||
protected function getCurrentMaintenance() {
|
protected function getCurrentMaintenance() {
|
||||||
$results = [];
|
$results = [];
|
||||||
|
|
||||||
foreach(\MaintenanceNotification::searchActive([]) as $notification) {
|
foreach(\MaintenanceNotification::searchOpen([]) as $notification) {
|
||||||
$item = [];
|
$item = [];
|
||||||
|
|
||||||
$from = new DateTime("@".$notification->from);
|
$from = new DateTime("@".$notification->from);
|
||||||
|
|||||||
@@ -355,7 +355,12 @@ class MaintenanceNotification extends mfBaseModel {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function searchActive($filter, $limit = false, $order = false) {
|
public static function searchOpen($filter = [], $limit = false, $order = false) {
|
||||||
|
$filter["to>"] = date("U");
|
||||||
|
|
||||||
|
return self::search($filter, $limit, $order);
|
||||||
|
}
|
||||||
|
public static function searchActiveOpen($filter = [], $limit = false, $order = false) {
|
||||||
$filter["to>"] = date("U");
|
$filter["to>"] = date("U");
|
||||||
$filter["sent"] = false;
|
$filter["sent"] = false;
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,6 @@ define("INTERNAL_USER_ID", $me->id);
|
|||||||
define("INTERNAL_USER_USERNAME", $me->username);
|
define("INTERNAL_USER_USERNAME", $me->username);
|
||||||
define("MFBASE_BYPASS_LOGIN", true);
|
define("MFBASE_BYPASS_LOGIN", true);
|
||||||
|
|
||||||
foreach(MaintenanceNotification::searchActive(["send_ts<" => date("U")]) as $notification) {
|
foreach(MaintenanceNotification::searchActiveOpen() as $notification) {
|
||||||
$notification->sendToRecipients();
|
$notification->sendToRecipients();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user