Skip to content

Commit

Permalink
select only necessary fields for orders #1391 for magento 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzaloebiz committed May 19, 2022
1 parent f345281 commit 2de85e6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Model/Api/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ protected function _getModifiedOrders($magentoStoreId)
$modifiedOrders = $this->_getCollection();
// select orders for the current Magento store id
$modifiedOrders->addFieldToFilter('store_id', ['eq' => $magentoStoreId]);
$modifiedOrders->addFieldToSelect(['store_id','created_at']);
//join with mailchimp_ecommerce_sync_data table to filter by sync data.
$modifiedOrders->getSelect()->joinLeft(
['m4m' => $this->_helper->getTableName('mailchimp_sync_ecommerce')],
Expand Down Expand Up @@ -238,6 +239,7 @@ protected function _getNewOrders($magentoStoreId)
$newOrders = $this->_getCollection();
// select carts for the current Magento store id
$newOrders->addFieldToFilter('store_id', ['eq' => $magentoStoreId]);
$newOrders->addFieldToSelect(['store_id','created_at']);
// filter by first date if exists.
if ($this->_firstDate) {
$newOrders->addFieldToFilter('created_at', ['gt' => $this->_firstDate]);
Expand Down

0 comments on commit 2de85e6

Please sign in to comment.