From: eileen Date: Wed, 10 Jul 2019 13:21:41 +0000 (+1200) Subject: Make return for query more like sql X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9858dc0b55217b77ec6f5be29339aa3ae3c00e6c;p=civicrm-core.git Make return for query more like sql --- 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"]; } /**