Report/SendEventErrors.php
authoredward <edward@roojs.com>
Fri, 5 Feb 2016 04:25:12 +0000 (12:25 +0800)
committeredward <edward@roojs.com>
Fri, 5 Feb 2016 04:25:12 +0000 (12:25 +0800)
Report/SendEventErrors.php

index 3a2fc76..41d3930 100644 (file)
@@ -61,43 +61,43 @@ class Pman_Admin_Report_SendEventErrors extends Pman_Roo
             $this->jerr("{$this->opts['group']} does not has any memeber");
         }
         
-        $events = DB_DataObject::factory('Events');
-        $events->selectAdd();
-        $events->selectAdd("
-            DISTINCT(Events.action) AS action,
-            COUNT(Events.id) AS total
-        ");
-        
-        $events->whereAdd("Events.event_when > NOW() - INTERVAL 1 DAY");
-        
-        if(!empty($this->opts['exclude'])){
-            $exclude = array_unique(array_filter(array_map('trim', explode(',', $this->opts['exclude']))));
-            
-            if(!empty($exclude)){
-                $events->whereAddIn('!Events.action', $exclude, 'string');
-            }
-        }
-        
-        $events->groupBy('Events.action');
-        $events->orderBy('Events.action ASC');
-        
-        $totals = $events->fetchAll('action', 'total');
-        
-        if(empty($totals)){
-            $this->jerr('Nothing to be sent');
-        }
-        
-        $subject = array();
-        
-        foreach ($totals as $k => $v){
-            $subject[] = "{$v} {$k}";
-        }
-        
-        $subject = implode(', ', $subject);
-        
-        if(!empty($this->opts['subject'])){
-            $subject = "{$this->opts['subject']} $subject";
-        }
+//        $events = DB_DataObject::factory('Events');
+//        $events->selectAdd();
+//        $events->selectAdd("
+//            DISTINCT(Events.action) AS action,
+//            COUNT(Events.id) AS total
+//        ");
+//        
+//        $events->whereAdd("Events.event_when > NOW() - INTERVAL 1 DAY");
+//        
+//        if(!empty($this->opts['exclude'])){
+//            $exclude = array_unique(array_filter(array_map('trim', explode(',', $this->opts['exclude']))));
+//            
+//            if(!empty($exclude)){
+//                $events->whereAddIn('!Events.action', $exclude, 'string');
+//            }
+//        }
+//        
+//        $events->groupBy('Events.action');
+//        $events->orderBy('Events.action ASC');
+//        
+//        $totals = $events->fetchAll('action', 'total');
+//        
+//        if(empty($totals)){
+//            $this->jerr('Nothing to be sent');
+//        }
+//        
+//        $subject = array();
+//        
+//        foreach ($totals as $k => $v){
+//            $subject[] = "{$v} {$k}";
+//        }
+//        
+//        $subject = implode(', ', $subject);
+//        
+//        if(!empty($this->opts['subject'])){
+//            $subject = "{$this->opts['subject']} $subject";
+//        }
         
         $events = DB_DataObject::factory('Events');
         $events->autoJoin();
@@ -118,12 +118,8 @@ class Pman_Admin_Report_SendEventErrors extends Pman_Roo
         
         $events->whereAdd("Events.event_when > NOW() - INTERVAL 1 DAY");
         
-        if(!empty($this->opts['exclude'])){
-            $exclude = array_unique(array_filter(array_map('trim', explode(',', $this->opts['exclude']))));
-            
-            if(!empty($exclude)){
-                $events->whereAddIn('!Events.action', $exclude, 'string');
-            }
+        if(!empty($exclude)){
+            $events->whereAddIn('!Events.action', $exclude, 'string');
         }
         
         $events->groupBy('Events.action');