fix sent update
authorAlan <alan@roojs.com>
Wed, 1 Nov 2023 03:35:06 +0000 (11:35 +0800)
committerAlan <alan@roojs.com>
Wed, 1 Nov 2023 03:35:06 +0000 (11:35 +0800)
DataObjects/Core_notify.php
Notify.php

index d8f343a..e316e0a 100644 (file)
@@ -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);
index 5ed6a7b..f524ff2 100644 (file)
@@ -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']);