CRM-20660: minor code cleanup.
authorAllen Shaw <allen@JoineryHQ.com>
Tue, 13 Jun 2017 16:19:18 +0000 (11:19 -0500)
committerAllen Shaw <allen@JoineryHQ.com>
Tue, 13 Jun 2017 16:19:18 +0000 (11:19 -0500)
CRM/Report/Form/Mailing/Summary.php

index 9ff9add70f9ec2ebfe47cb7cbc75dac62a75e208..c5373ed425bb5b4de5910874cfa43c61d3ec1a17 100644 (file)
@@ -358,7 +358,7 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form {
     // is the key in $this->_columns, and $fieldName is the key in that array's
     // ['fields'] array.
     // Reference: CRM-20660
-    $distinct_count_columns = array(
+    $distinctCountColumns = array(
       'civicrm_mailing_event_queue.queue_count',
       'civicrm_mailing_event_delivered.delivered_count',
       'civicrm_mailing_event_bounce.bounce_count',
@@ -393,12 +393,10 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form {
               if (in_array($tableName, $count_tables)) {
                 // Use the DISTINCT keyword appropriately, based on the contents
                 // of $distinct_count_columns.
-                if (in_array("{$tableName}.{$fieldName}", $distinct_count_columns)) {
+                $distinct = '';
+                if (in_array("{$tableName}.{$fieldName}", $distinctCountColumns)) {
                   $distinct = 'DISTINCT';
                 }
-                else {
-                  $distinct = '';
-                }
                 $select[] = "count($distinct {$field['dbAlias']}) as {$tableName}_{$fieldName}";
               }
               else {