本文整理汇总了PHP中Admin_DA::getHourHistory方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin_DA::getHourHistory方法的具体用法?PHP Admin_DA::getHourHistory怎么用?PHP Admin_DA::getHourHistory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin_DA
的用法示例。
在下文中一共展示了Admin_DA::getHourHistory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _mergeDeliveryPerformanceData
/**
* Take impressions from today's/yesterday's statistics and use them to augment the overall statistics.
*
* This step is only necessary because the underlying query builder is incapable of
* joining a table to itself, which would be necessary to gather today's impressions
* at the same time as those for the whole period.
*
* @access private
* @param array $aReportData The result of
* {@link Plugins_Reports_Standard_LiveCampaignDeliveryReport::_getDeliveryPerformanceDataRange()}
* for the report period.
* @param array $aYesterdayData The result of
* {@link Plugins_Reports_Standard_LiveCampaignDeliveryReport::_getDeliveryPerformanceDataRange()}
* for "yesterday".
* @param OA_Admin_DaySpan $oSpanYesterday The OA_Admin_DaySpan object for "yesterday".
* @param array $aTodayData The result of
* {@link Plugins_Reports_Standard_LiveCampaignDeliveryReport::_getDeliveryPerformanceDataRange()}
* for "today".
* @param OA_Admin_DaySpan $oSpanToday The OA_Admin_DaySpan object for "today".
* @return array An array of campaign information as per the $aReportData array, but also
* including 'yesterdays_impressions' and 'todays_impressions', as well as
* an hourly breakdown of "yesterday's" and "today's" impressions in hourly
* format in 'yesterdays_impressions_by_hour' and 'todays_impressions_by_hour'.
*/
function _mergeDeliveryPerformanceData($aReportData, $aYesterdayData, $oSpanYesterday, $aTodayData, $oSpanToday)
{
$aData = array();
foreach ($aReportData as $aCampaignData) {
$campaignId = $aCampaignData['campaign_id'];
// Add yesterday's impressions to the campaign report period data
$aCampaignDataYesterday = $this->_findMatchingCampaignData($campaignId, $aYesterdayData);
$yesterdaysImpressions = $aCampaignDataYesterday['campaign_impressions'];
$aCampaignData['yesterdays_impressions'] = $yesterdaysImpressions;
// Get and add yesterday's impressions by hour
$yesterdayDateString = $oSpanYesterday->getStartDateString();
$aYesterdaysImpressionsByHour = Admin_DA::getHourHistory(array('placement_id' => $campaignId, 'day_begin' => $yesterdayDateString, 'day_end' => $yesterdayDateString));
$aCampaignData['yesterdays_impressions_by_hour'] = $aYesterdaysImpressionsByHour;
// Add today's impressions to the campaign report period data
$aCampaignDataToday = $this->_findMatchingCampaignData($campaignId, $aTodayData);
$todaysImpressions = $aCampaignDataToday['campaign_impressions'];
$aCampaignData['todays_impressions'] = $todaysImpressions;
// Get and add today's impressions by hour
$todayDateString = $oSpanToday->getStartDateString();
$aTodaysImpressionsByHour = Admin_DA::getHourHistory(array('placement_id' => $campaignId, 'day_begin' => $todayDateString, 'day_end' => $todayDateString));
$aCampaignData['todays_impressions_by_hour'] = $aTodaysImpressionsByHour;
// Add the newly merged data for this campaign to the return array
$aData[] = $aCampaignData;
}
return $aData;
}