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


PHP OA_Dal::quoteInterval方法代码示例

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


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

示例1: _pruneDataSummaryAdZoneAssocOldData

 /**
  * A method to prune the data_summary_ad_zone_assoc table
  * Pruning can be performed where zone_id = 0 (i.e. for direct selection) and where the entry is older than MAX_PREVIOUS_AD_DELIVERY_INFO_LIMIT minutes ago.
  *
  * @return integer : number of records deleted
  */
 function _pruneDataSummaryAdZoneAssocOldData()
 {
     $doDSAZA = OA_Dal::factoryDO('data_summary_ad_zone_assoc');
     $doDSAZA->whereAdd('zone_id=0', 'AND');
     $doDSAZA->whereAdd('created < DATE_ADD(' . $this->oDbh->quote(OA::getNow()) . ', ' . OA_Dal::quoteInterval(-MAX_PREVIOUS_AD_DELIVERY_INFO_LIMIT, 'SECOND') . ')', 'AND');
     return $doDSAZA->delete(true, false);
 }
开发者ID:hostinger,项目名称:revive-adserver,代码行数:13,代码来源:Pruning.php

示例2: getZonesForecasts

 /**
  * Get all zones forecasts by querying last hour's impressions for each zone
  * This function will look at the hour before the specified OI
  * to determine how much traffic to expected in the specified OI.
  *
  * @param string $intervalStart  Interval start date of OI to forecast
  * @param string $intervalEnd  Interval end date of OI to forecast
  * @return array  array( zoneId => forecastForThisZone, ... )
  */
 public function getZonesForecasts($intervalStart, $intervalEnd)
 {
     OA::debug('  - Selecting Zones forecasts for all managers for OI from ' . $intervalStart . ' to ' . $intervalEnd, PEAR_LOG_INFO);
     $operationInterval = $GLOBALS['_MAX']['CONF']['maintenance']['operationInterval'];
     $oneHourInterval = OA_Dal::quoteInterval(1, 'hour');
     $query = "SELECT\n                      d.zone_id AS zone_id,\n                      sum(impressions) AS impressions,\n                      count(DISTINCT operation_interval_id) as count\n                  FROM\n                  {$this->_getTablename('data_intermediate_ad')} AS d\n                  WHERE\n                          d.operation_interval = '{$operationInterval}'\n                      AND d.date_time < '{$intervalStart}'\n                      AND d.date_time >= DATE_SUB('{$intervalStart}', {$oneHourInterval})\n                  GROUP BY d.zone_id\n                  ORDER BY zone_id\n                  ";
     $rc = $this->oDbh->query($query);
     $aResult = array();
     while ($aRow = $rc->fetchRow()) {
         // we divide by count in the case where we picked up several OIs that last less than one hour
         $aResult[$aRow['zone_id']] = round($aRow['impressions'] / $aRow['count']);
     }
     return $aResult;
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:23,代码来源:Priority.php


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