added missed clause

This commit is contained in:
CiviWare Solutions 2018-10-31 23:04:01 +05:30
parent ed2bba47e3
commit 2419a5752e

View File

@ -65,6 +65,7 @@ class CRM_ConstituentsOnly_BAO_Query extends CRM_Contact_BAO_Query_Interface {
LEFT JOIN civicrm_contact cc1 LEFT JOIN civicrm_contact cc1
ON (cr.contact_id_a = cc1.id) ON (cr.contact_id_a = cc1.id)
WHERE contact_a.do_not_trade = 1 AND (cr.id IS NULL OR cc1.is_deleted = 1 OR cc1.do_not_trade = 1) WHERE contact_a.do_not_trade = 1 AND (cr.id IS NULL OR cc1.is_deleted = 1 OR cc1.do_not_trade = 1)
AND contact_a.id <> cc1.id
UNION UNION
SELECT contact_a.id SELECT contact_a.id
FROM civicrm_contact contact_a FROM civicrm_contact contact_a
@ -74,6 +75,7 @@ class CRM_ConstituentsOnly_BAO_Query extends CRM_Contact_BAO_Query_Interface {
LEFT JOIN civicrm_contact cc1 LEFT JOIN civicrm_contact cc1
ON (cr.contact_id_b = cc1.id) ON (cr.contact_id_b = cc1.id)
WHERE contact_a.do_not_trade = 1 AND (cr.id IS NULL OR cc1.is_deleted = 1 OR cc1.do_not_trade = 1) WHERE contact_a.do_not_trade = 1 AND (cr.id IS NULL OR cc1.is_deleted = 1 OR cc1.do_not_trade = 1)
AND contact_a.id <> cc1.id
) AS temp GROUP BY id ) AS temp GROUP BY id
) )
"; ";