orderFactory = $orderFactory; parent::__construct($context, $data); $this->setSyncStatusData(); } /** * @return $this * @throws \Magento\Framework\Exception\LocalizedException */ public function getOrderCollection() { $collection = $this->orderFactory->create()->addAttributeToSelect('*'); return $collection; } /** * @return int|void * @throws \Magento\Framework\Exception\LocalizedException */ public function getSyncOrder() { $sync = $this->getOrderCollection()->addFieldToFilter( self::AC_SYNC_STATUS, [ ['eq' => CronConfig::SYNCED], ] ); return count($sync); } /** * @return int|void * @throws \Magento\Framework\Exception\LocalizedException */ public function getTotalOrder() { $total = $this->getOrderCollection()->addFieldToFilter( self::AC_SYNC_STATUS, [ ['eq' => CronConfig::SYNCED], ['eq' => CronConfig::NOT_SYNCED], ['eq' => CronConfig::FAIL_SYNCED], ] ); return count($total); } /** * @return int|void * @throws \Magento\Framework\Exception\LocalizedException */ public function getNotSyncOrder() { $notSync = $this->getOrderCollection()->addFieldToFilter( self::AC_SYNC_STATUS, [ ['eq' => CronConfig::NOT_SYNCED], ] )->getData(); return count($notSync); } /** * @return int|void * @throws \Magento\Framework\Exception\LocalizedException */ public function getFailedSync() { $failSync = $this->getOrderCollection()->addFieldToFilter( self::AC_SYNC_STATUS, [ ['eq' => CronConfig::FAIL_SYNCED], ] ); return count($failSync); } }