@@ -146,32 +146,6 @@ public function addStoreFilter($storeIds)
146
146
return $ this ;
147
147
}
148
148
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
-
175
149
/**
176
150
* Get select count sql
177
151
*
@@ -186,36 +160,6 @@ public function getSelectCountSql()
186
160
return $ countSelect ;
187
161
}
188
162
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
-
219
163
/**
220
164
* Separate query for product and order data
221
165
*
0 commit comments