$summary['total']['currencyCount'] = count($summary['total']['median']);
- if (!empty($summary['total']['amount'])) {
- $summary['total']['amount'] = implode(', ', $summary['total']['amount']);
- $summary['total']['avg'] = implode(', ', $summary['total']['avg']);
- $summary['total']['mode'] = implode(', ', $summary['total']['mode']);
- $summary['total']['median'] = implode(', ', $summary['total']['median']);
- }
- else {
- $summary['total']['amount'] = $summary['total']['avg'] = $summary['total']['median'] = 0;
- }
-
$this->addBasicCancelStatsToSummary($summary, $where, $from);
return $summary;
$summary['total']['amount'][] = CRM_Utils_Money::format($dao->total_amount, $dao->currency);
$summary['total']['avg'][] = CRM_Utils_Money::format($dao->total_avg, $dao->currency);
}
+ if (!empty($summary['total']['amount'])) {
+ $summary['total']['amount'] = implode(', ', $summary['total']['amount']);
+ $summary['total']['avg'] = implode(', ', $summary['total']['avg']);
+ }
+ else {
+ $summary['total']['amount'] = $summary['total']['avg'] = $summary['total']['median'] = 0;
+ }
return $summary;
}
) as conts
GROUP BY currency";
- $summary['total']['mode'] = CRM_Contribute_BAO_Contribution::computeStats('mode', $modeSQL);
+ $mode = CRM_Contribute_BAO_Contribution::computeStats('mode', $modeSQL);
+ $summary['total']['mode'] = implode(', ', (array) $mode);
}
/**
*/
protected function addMedianToStats(&$summary, $where, $from) {
$medianSQL = "{$from} {$where} AND civicrm_contribution.contribution_status_id = 1 ";
- $summary['total']['median'] = CRM_Contribute_BAO_Contribution::computeStats('median', $medianSQL, 'civicrm_contribution');
+ $median = CRM_Contribute_BAO_Contribution::computeStats('median', $medianSQL, 'civicrm_contribution');
+ $summary['total']['median'] = implode(', ', (array) $median);
}
/**