Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Helper.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
19 
25  public function __construct(
27  \Magento\Reports\Model\ResourceModel\Helper $reportsResourceHelper,
28  $modulePrefix = 'sales'
29  ) {
30  parent::__construct($resource, $modulePrefix);
31  $this->_reportsResourceHelper = $reportsResourceHelper;
32  }
33 
44  $aggregation,
45  $aggregationAliases,
46  $mainTable,
47  $aggregationTable
48  ) {
49  $connection = $this->_resource->getConnection('sales');
50  if ($aggregation == $aggregationAliases['monthly']) {
51  $this->_reportsResourceHelper->updateReportRatingPos(
53  'month',
54  'qty_ordered',
55  $mainTable,
56  $aggregationTable
57  );
58  } elseif ($aggregation == $aggregationAliases['yearly']) {
59  $this->_reportsResourceHelper->updateReportRatingPos(
61  'year',
62  'qty_ordered',
63  $mainTable,
64  $aggregationTable
65  );
66  } else {
67  $this->_reportsResourceHelper->updateReportRatingPos(
69  'day',
70  'qty_ordered',
71  $mainTable,
72  $aggregationTable
73  );
74  }
75 
76  return $this;
77  }
78 }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
$resource
Definition: bulk.php:12
__construct(\Magento\Framework\App\ResourceConnection $resource, \Magento\Reports\Model\ResourceModel\Helper $reportsResourceHelper, $modulePrefix='sales')
Definition: Helper.php:25
getBestsellersReportUpdateRatingPos( $aggregation, $aggregationAliases, $mainTable, $aggregationTable)
Definition: Helper.php:43
$connection
Definition: bulk.php:13