From 7b79e92134914c1600b3fd4e9c07c726643b801b Mon Sep 17 00:00:00 2001 From: Alan Date: Wed, 1 Nov 2023 11:35:06 +0800 Subject: [PATCH] fix sent update --- DataObjects/Core_notify.php | 2 +- Notify.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/DataObjects/Core_notify.php b/DataObjects/Core_notify.php index d8f343ab..e316e0ae 100644 --- a/DataObjects/Core_notify.php +++ b/DataObjects/Core_notify.php @@ -352,7 +352,7 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject if(strtotime($this->act_when) > strtotime("NOW")){ $this->act_when = $this->sqlValue('NOW()'); } - $this->sent = $this->sent == '0000-00-00 00:00:00' ? $this->sqlValue('NOW()') :$this->sent; // do not update if sent..... + $this->sent = strtotime($this->sent) < 1 ? $this->sqlValue('NOW()') :$this->sent; // do not update if sent..... $this->msgid = $msgid; $this->event_id = $event->id; $this->update($ww); diff --git a/Notify.php b/Notify.php index 5ed6a7b5..f524ff2f 100644 --- a/Notify.php +++ b/Notify.php @@ -225,6 +225,7 @@ class Pman_Core_Notify extends Pman if (!$this->force) { $w->whereAdd('act_when < NOW()'); // eg.. not if future.. } + $w->orderBy('act_when ASC'); // oldest first. $total = min($w->count(), $opts['limit']); -- 2.39.2