14 class Collection extends \Magento\Sales\Model\ResourceModel\Report\Collection\AbstractCollection
43 \Psr\Log\LoggerInterface
$logger,
45 \
Magento\Framework\Event\ManagerInterface $eventManager,
49 $resource->init($this->_aggregationTable);
58 if (
'month' == $this->_period) {
59 $this->_periodFormat = $this->
getConnection()->getDateFormatSql(
'period',
'%Y-%m');
60 }
elseif (
'year' == $this->_period) {
61 $this->_periodFormat = $this->
getConnection()->getDateFormatSql(
'period',
'%Y');
63 $this->_periodFormat = $this->
getConnection()->getDateFormatSql(
'period',
'%Y-%m-%d');
67 $this->_selectedColumns = [
70 'percent' =>
'percent',
71 'orders_count' =>
'SUM(orders_count)',
72 'tax_base_amount_sum' =>
'SUM(tax_base_amount_sum)',
96 $this->
getSelect()->group([$this->_periodFormat,
'code',
'percent']);
100 $this->
getSelect()->group([$this->_periodFormat]);
102 return parent::_beforeLoad();
elseif(isset( $params[ 'redirect_parent']))
__construct(\Magento\Framework\Data\Collection\EntityFactory $entityFactory, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Sales\Model\ResourceModel\Report $resource, \Magento\Framework\DB\Adapter\AdapterInterface $connection=null)