From 9858dc0b55217b77ec6f5be29339aa3ae3c00e6c Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 11 Jul 2019 01:21:41 +1200 Subject: [PATCH] Make return for query more like sql --- CRM/Export/BAO/Export.php | 4 +--- CRM/Export/BAO/ExportProcessor.php | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index d9d25089b8..a72677c9b4 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -201,13 +201,11 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c $processor->setComponentTable($componentTable); $processor->setComponentClause($componentClause); - list($query, $select, $from, $where, $having) = $processor->runQuery($params, $order); + list($query, $queryString) = $processor->runQuery($params, $order); // This perhaps only needs calling when $mergeSameHousehold == 1 self::buildRelatedContactArray($selectAll, $ids, $processor, $componentTable); - $queryString = "$select $from $where $having"; - $groupBy = self::getGroupBy($processor, $query); $queryString .= $groupBy; diff --git a/CRM/Export/BAO/ExportProcessor.php b/CRM/Export/BAO/ExportProcessor.php index e40099aa40..94526575c8 100644 --- a/CRM/Export/BAO/ExportProcessor.php +++ b/CRM/Export/BAO/ExportProcessor.php @@ -721,7 +721,7 @@ class CRM_Export_BAO_ExportProcessor { list($select, $from, $where, $having) = $query->query(); $this->setQueryFields($query->_fields); $whereClauses = ['trash_clause' => "contact_a.is_deleted != 1"]; - if ($this->getRequestedFields() && ($this->getComponentTable())){ + if ($this->getRequestedFields() && ($this->getComponentTable())) { $from .= " INNER JOIN " . $this->getComponentTable() . " ctTable ON ctTable.contact_id = contact_a.id "; } elseif ($this->getComponentClause()) { @@ -741,7 +741,7 @@ class CRM_Export_BAO_ExportProcessor { else { $where .= " AND " . implode(' AND ', $whereClauses); } - return [$query, $select, $from, $where . $addressWhere, $having]; + return [$query, "$select $from $where $having"]; } /** -- 2.25.1