NotifySend.php
authorAlan <alan@roojs.com>
Fri, 6 Oct 2023 04:47:17 +0000 (12:47 +0800)
committerAlan <alan@roojs.com>
Fri, 6 Oct 2023 04:47:17 +0000 (12:47 +0800)
NotifySend.php

index 0eefd9c..ee8ce21 100644 (file)
@@ -345,15 +345,7 @@ class Pman_Core_NotifySend extends Pman
         $fail = false;
         require_once 'Mail.php';
         
-        $core_domain = DB_DataObject::factory('core_domain');
-        if(!$core_domain->get('domain', $dom)){
-            $core_domain = DB_DataObject::factory('core_domain');
-            $core_domain->setFrom(array(
-                'domain' => $dom
-            ));
-            $core_domain->insert();
-        }
-         
+        $core_domain = DB_DataObject::factory('core_domain')->loadOrCreate($dom);
         
         $this->server->initHelo();
         
@@ -407,6 +399,7 @@ class Pman_Core_NotifySend extends Pman
                     
                     $core_notify = DB_DataObject::factory($this->table);
                     $core_notify->domain_id = $core_domain->id;
+                    $core_notify->server_id = $this->server->id;
                     $core_notify->whereAdd("
                         sent >= NOW() - INTERVAL $seconds SECOND
                     ");