本文整理匯總了PHP中myPartnerUtils::daily_activity_to_graph方法的典型用法代碼示例。如果您正苦於以下問題:PHP myPartnerUtils::daily_activity_to_graph方法的具體用法?PHP myPartnerUtils::daily_activity_to_graph怎麽用?PHP myPartnerUtils::daily_activity_to_graph使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類myPartnerUtils
的用法示例。
在下文中一共展示了myPartnerUtils::daily_activity_to_graph方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getPartnerUsageGraph
public static function getPartnerUsageGraph($year, $month, $partner, $resolution = 'days', $tzOffset = null)
{
if (!$resolution) {
$resolution = 'days';
}
$start_date = $year . '-' . ($month ? $month : '01') . '-01';
switch ($resolution) {
case 'weeks':
case 'days':
$end_date = $year . '-' . $month . '-' . date('t', strtotime($year . '-' . $month . '-01'));
break;
case 'months':
$start_date = $year . '-' . '01-01';
if ((int) date('Y') == $year) {
$end_date = date('Y-m-d');
} else {
$end_date = (int) $year . '-12-31';
}
break;
}
$data = myPartnerUtils::getPartnerBandwidthUsageFromDWH($partner->getId(), $start_date, $end_date, $resolution, $tzOffset);
if ($resolution != 'months') {
$graph_points['line'] = myPartnerUtils::daily_activity_to_graph($data, $resolution, $start_date);
} else {
//$activity = myPartnerUtils::collectPartnerUsageFromDWH($partner, 1, $end_date, true );
$graph_points['line'] = myPartnerUtils::year_activity_to_graph($data, $year);
}
$strGraphLine = '';
// sort array by keys
ksort($graph_points['line']);
foreach ($graph_points['line'] as $point => $usage) {
$strGraphLine .= (int) $point . ',' . $usage . ';';
}
$graph_points['line'] = $strGraphLine;
return $graph_points;
}