From 6eac96f21d67b99a2716c1ed7a29ab35a68d8088 Mon Sep 17 00:00:00 2001 From: gonzalo Date: Wed, 27 Nov 2024 12:58:41 -0300 Subject: [PATCH] group batches by store #2041 for magento 2.4 --- Cron/GenerateStatistics.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Cron/GenerateStatistics.php b/Cron/GenerateStatistics.php index 4fd80243..9deb0531 100644 --- a/Cron/GenerateStatistics.php +++ b/Cron/GenerateStatistics.php @@ -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)); @@ -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 = [];