当前位置: 首页>>代码示例>>PHP>>正文


PHP myPartnerUtils::dailyActivityGraph方法代码示例

本文整理汇总了PHP中myPartnerUtils::dailyActivityGraph方法的典型用法代码示例。如果您正苦于以下问题:PHP myPartnerUtils::dailyActivityGraph方法的具体用法?PHP myPartnerUtils::dailyActivityGraph怎么用?PHP myPartnerUtils::dailyActivityGraph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在myPartnerUtils的用法示例。


在下文中一共展示了myPartnerUtils::dailyActivityGraph方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPartnerUsageGraph

 /**
  * @param int $startDate
  * @param int $endDate
  * @param Partner $partner
  * @param reportInterval $resolution
  * @param int $tzOffset
  * @return string
  */
 public static function getPartnerUsageGraph($startDate, $endDate, Partner $partner, $resolution = reportInterval::DAYS, $tzOffset = null, $reportType = myReportsMgr::REPORT_TYPE_PARTNER_BANDWIDTH_USAGE)
 {
     $reportFilter = new reportsInputFilter();
     $reportFilter->from_date = $startDate;
     $reportFilter->to_date = $endDate;
     $reportFilter->from_day = date("Ymd", $startDate);
     $reportFilter->to_day = date("Ymd", $endDate);
     $reportFilter->interval = $resolution;
     // if TZ offset provided, add TZ offset to the UTC time created above to reflect the user's timezone
     // in myReportsMgr the offset will be later cleaned again to reflect UTC time so that the DWH query will be correct (with the TIME_SHIFT)
     if (!is_null($tzOffset)) {
         $tzOffsetSec = $tzOffset * 60;
         $reportFilter->timeZoneOffset = $tzOffsetSec;
         $reportFilter->from_date = $reportFilter->from_date + $tzOffsetSec;
         $reportFilter->to_date = $reportFilter->to_date + $tzOffsetSec;
     }
     $data = myReportsMgr::getGraph($partner->getId(), $reportType, $reportFilter, null, null);
     $graphPointsLine = array();
     if ($resolution == reportInterval::MONTHS) {
         $graphPointsLine = myPartnerUtils::annualActivityGraph($data);
     } else {
         $graphPointsLine = myPartnerUtils::dailyActivityGraph($data, $startDate);
     }
     ksort($graphPointsLine);
     $graphLine = '';
     foreach ($graphPointsLine as $point => $usage) {
         $graphLine .= intval($point) . ",{$usage};";
     }
     return $graphLine;
 }
开发者ID:dozernz,项目名称:server,代码行数:38,代码来源:myPartnerUtils.class.php


注:本文中的myPartnerUtils::dailyActivityGraph方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。