Skip to content

Commit

Permalink
group batches by store #2041 for magento 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzaloebiz committed Nov 27, 2024
1 parent 720d303 commit 6eac96f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Cron/GenerateStatistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ public function execute()
$storeStatistics['mailchimp'] = $this->getMailchimpTotals($storeId);
$storeStatistics['magento'] = $this->getMagentoTotals($storeId);
$data['statistics']['store'][$storeId] = $storeStatistics;
$data['batches'] = $this->getBatches($storeId, $mailChimpStoreId);
$data['jobs'] = $this->getJobs();
$data['batches']['store'][$storeId] = $this->getBatches($storeId, $mailChimpStoreId);
}
}
$data['jobs'] = $this->getJobs();
if (!empty($data)) {
$mailchimpNotification = $this->mailchimpNotificationFactory->create();
$mailchimpNotification->setNotificationData(json_encode($data));
Expand Down Expand Up @@ -243,6 +243,8 @@ private function getBatches($storeId,$mailchimpStoreId)
foreach ($collection as $item) {
$batch = [];
$batch['id'] = $item['batch_id'];
$batch['magento_store_id'] = $item['store_id'];
$batch['mailchimp_store_id'] = $item['mailchimp_store_id'];
$batch['date'] = $item['modified_date'];
$batch['status'] = $item['status'];
$counters = [];
Expand Down

0 comments on commit 6eac96f

Please sign in to comment.