13 class Order extends \Magento\Sales\Model\ResourceModel\Report\Collection\AbstractCollection
39 \Psr\Log\LoggerInterface
$logger,
41 \
Magento\Framework\Event\ManagerInterface $eventManager,
45 $resource->init(
'sales_shipping_aggregated_order');
57 if (
'month' == $this->_period) {
58 $this->_periodFormat =
$connection->getDateFormatSql(
'period',
'%Y-%m');
59 }
elseif (
'year' == $this->_period) {
60 $this->_periodFormat =
$connection->getDateExtractSql(
65 $this->_periodFormat =
$connection->getDateFormatSql(
'period',
'%Y-%m-%d');
69 $this->_selectedColumns = [
71 'shipping_description' =>
'shipping_description',
72 'orders_count' =>
'SUM(orders_count)',
73 'total_shipping' =>
'SUM(total_shipping)',
74 'total_shipping_actual' =>
'SUM(total_shipping_actual)',
99 $this->
getSelect()->group([$this->_periodFormat,
'shipping_description']);
102 $this->
getSelect()->group([$this->_periodFormat]);
104 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)