From: Kurund Jalmi Date: Mon, 17 Aug 2015 07:47:22 +0000 (+0530) Subject: CRM-16719: stats fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7851a058b26e9f18adeae8ea4849457f81669570;p=civicrm-core.git CRM-16719: stats fixes --- diff --git a/CRM/Report/Form/ActivitySummary.php b/CRM/Report/Form/ActivitySummary.php index b851dbd7d9..c73202e479 100644 --- a/CRM/Report/Form/ActivitySummary.php +++ b/CRM/Report/Form/ActivitySummary.php @@ -458,10 +458,14 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { $statistics = parent::statistics($rows); $totalType = $totalActivity = $totalDuration = 0; + $query = "SELECT SUM(activity_civireport.duration) + FROM civicrm_activity activity_civireport + {$this->_where} {$this->_groupBy}"; + $actSQL = "SELECT COUNT(DISTINCT {$this->_aliases['civicrm_activity']}.activity_type_id ) as civicrm_activity_activity_type_id_count, COUNT(DISTINCT {$this->_aliases['civicrm_activity']}.id ) as civicrm_activity_activity_id_count, - SUM({$this->_aliases['civicrm_activity']}.duration ) as civicrm_activity_activity_duration + ($query) as civicrm_activity_activity_duration {$this->_from} {$this->_where} {$this->_groupBy}"; $actDAO = CRM_Core_DAO::executeQuery($actSQL);