13 class Sales extends \Magento\Backend\Block\Dashboard\Bar
18 protected $_template =
'Magento_Backend::dashboard/salebar.phtml';
38 parent::__construct($context, $collectionFactory,
$data);
46 if (!$this->_moduleManager->isEnabled(
'Magento_Reports')) {
57 $collection = $this->_collectionFactory->create()->calculateSales($isFilter);
62 $storeIds = $this->_storeManager->getWebsite($this->
getRequest()->getParam(
'website'))->getStoreIds();
63 $collection->addFieldToFilter(
'store_id', [
'in' => $storeIds]);
65 $storeIds = $this->_storeManager->getGroup($this->
getRequest()->getParam(
'group'))->getStoreIds();
66 $collection->addFieldToFilter(
'store_id', [
'in' => $storeIds]);
72 $this->
addTotal(
__(
'Lifetime Sales'), $sales->getLifetime());
73 $this->
addTotal(
__(
'Average Order'), $sales->getAverage());
elseif(isset( $params[ 'redirect_parent']))
__construct(\Magento\Backend\Block\Template\Context $context, \Magento\Reports\Model\ResourceModel\Order\CollectionFactory $collectionFactory, \Magento\Framework\Module\Manager $moduleManager, array $data=[])
addTotal($label, $value, $isQuantity=false)