コード例 #1
0
 /**
  * @param string $aggregation
  * @param array $aggregationAliases
  * @param string $expectedType
  *
  * @dataProvider getBestsellersReportUpdateRatingPosProvider
  */
 public function testGetBestsellersReportUpdateRatingPos($aggregation, $aggregationAliases, $expectedType)
 {
     $mainTable = 'main_table';
     $aggregationTable = 'aggregation_table';
     $this->resourceHelper->expects($this->once())->method('updateReportRatingPos')->with($this->connectionMock, $expectedType, 'qty_ordered', $mainTable, $aggregationTable);
     $this->appResource->expects($this->once())->method('getConnection')->with('sales')->willReturn($this->connectionMock);
     $this->helper->getBestsellersReportUpdateRatingPos($aggregation, $aggregationAliases, $mainTable, $aggregationTable);
 }
コード例 #2
0
 /**
  * Update rating position
  *
  * @param string $aggregation
  * @return $this
  */
 protected function _updateRatingPos($aggregation)
 {
     $aggregationTable = $this->getTable('sales_bestsellers_aggregated_' . $aggregation);
     $aggregationAliases = ['daily' => self::AGGREGATION_DAILY, 'monthly' => self::AGGREGATION_MONTHLY, 'yearly' => self::AGGREGATION_YEARLY];
     $this->_salesResourceHelper->getBestsellersReportUpdateRatingPos($aggregation, $aggregationAliases, $this->getMainTable(), $aggregationTable);
     return $this;
 }