Skip to content

Commit 436e536

Browse files
author
Roman Ganin
committed
Merge remote-tracking branch 'origin/MAGETWO-36857' into develop
2 parents d05cc2a + b8a8610 commit 436e536

File tree

2 files changed

+0
-330
lines changed

2 files changed

+0
-330
lines changed

app/code/Magento/Reports/Model/Resource/Quote/Item/Collection.php

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -146,32 +146,6 @@ public function addStoreFilter($storeIds)
146146
return $this;
147147
}
148148

149-
/**
150-
* Add customer data
151-
*
152-
* @param array|null $filter
153-
* @return $this
154-
*/
155-
public function addCustomerData($filter = null)
156-
{
157-
$customersSelect = $this->customerResource->getReadConnection()->select();
158-
$customersSelect->from(['customer' => $this->customerResource->getTable('customer_entity')], 'entity_id');
159-
if (isset($filter['customer_name'])) {
160-
$customersSelect = $this->getCustomerNames($customersSelect);
161-
$customerName = $customersSelect->getAdapter()->getConcatSql(['cust_fname.value', 'cust_lname.value'], ' ');
162-
$customersSelect->where(
163-
$customerName . ' LIKE ?',
164-
'%' . $filter['customer_name'] . '%'
165-
);
166-
}
167-
if (isset($filter['email'])) {
168-
$customersSelect->where('customer.email LIKE ?', '%' . $filter['email'] . '%');
169-
}
170-
$filteredCustomers = $this->customerResource->getReadConnection()->fetchCol($customersSelect);
171-
$this->getSelect()->where('main_table.customer_id IN (?)', $filteredCustomers);
172-
return $this;
173-
}
174-
175149
/**
176150
* Get select count sql
177151
*
@@ -186,36 +160,6 @@ public function getSelectCountSql()
186160
return $countSelect;
187161
}
188162

189-
/**
190-
* @param \Magento\Framework\DB\Select $select
191-
* @return \Magento\Framework\DB\Select
192-
*/
193-
protected function getCustomerNames($select)
194-
{
195-
$attrFirstName = $this->customerResource->getAttribute('firstname');
196-
$attrFirstNameId = (int)$attrFirstName->getAttributeId();
197-
$attrFirstNameTableName = $attrFirstName->getBackend()->getTable();
198-
$attrLastName = $this->customerResource->getAttribute('lastname');
199-
$attrLastNameId = (int)$attrLastName->getAttributeId();
200-
$attrLastNameTableName = $attrLastName->getBackend()->getTable();
201-
$select->joinInner(
202-
['cust_fname' => $attrFirstNameTableName],
203-
'customer.entity_id = cust_fname.entity_id',
204-
['firstname' => 'cust_fname.value']
205-
)->joinInner(
206-
['cust_lname' => $attrLastNameTableName],
207-
'customer.entity_id = cust_lname.entity_id',
208-
['lastname' => 'cust_lname.value']
209-
)->where(
210-
'cust_fname.attribute_id = ?',
211-
(int)$attrFirstNameId
212-
)->where(
213-
'cust_lname.attribute_id = ?',
214-
(int)$attrLastNameId
215-
);
216-
return $select;
217-
}
218-
219163
/**
220164
* Separate query for product and order data
221165
*

app/code/Magento/Reports/Test/Unit/Model/Resource/Quote/Item/CollectionTest.php

Lines changed: 0 additions & 274 deletions
This file was deleted.

0 commit comments

Comments
 (0)