Commit 02ab0320 authored by totten's avatar totten

Revert "Alter Index to be of structure as suggeted by Dave for performance...

Revert "Alter Index to be of structure as suggeted by Dave for performance improvement and change the group by on temporary table to be that of membership_id not contact_id so it correctly reports the max receive_date matching the memebership record"

This reverts commit bdb10f0c.
parent aca380dd
......@@ -513,14 +513,14 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form {
}
$tempTable = CRM_Core_DAO::createTempTableName('civicrm_report_memcontr', TRUE);
$sql = "
CREATE TEMPORARY TABLE $tempTable (INDEX (entity_id, contact_id, receive_date))
CREATE TEMPORARY TABLE $tempTable (index (contact_id, receive_date, entity_id))
SELECT cc.contact_id, max(cc.receive_date) as receive_date, cmp.membership_id as entity_id
FROM civicrm_membership_payment cmp
INNER JOIN civicrm_contribution cc
ON cc.id = cmp.contribution_id
WHERE cc.is_test = 0
$dateWhere
GROUP BY cmp.membership_id";
GROUP BY cc.contact_id";
CRM_Core_DAO::executeQuery($sql);
return $tempTable;
}
......
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