Commit 3b9c8022 authored by sluc23's avatar sluc23

set table alias con count distinct for matrix

parent 9628a026
......@@ -41,7 +41,8 @@ class CRM_Reportplus_Form_Contribute_Matrix extends CRM_Reportplus_Form_Matrix {
'count_distinct' => array(
'title' => ts('Unique Contacts', array('domain' => 'com.ixiam.modules.reportplus')),
'default' => FALSE,
'dbAlias' => 'contact_civireport.id',
'alias' => 'civicrm_contribution',
'dbAlias' => 'contact_id',
),
),
'grouping' => 'statistics-fields',
......
......@@ -152,7 +152,7 @@ class CRM_Reportplus_Form_Matrix extends CRM_Reportplus_Form {
break;
case 'count_distinct':
$select[] = "COUNT(DISTINCT {$field['dbAlias']}) as 'value'";
$select[] = "COUNT(DISTINCT " . $this->_aliases[$field['alias']] . ".{$field['dbAlias']}) as 'value'";
break;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment