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


PHP CM_Db_Db::execRead方法代码示例

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


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

示例1: _findByIp

 /**
  * @param int $ip
  * @return CM_Model_Location|null
  */
 private static function _findByIp($ip)
 {
     $result = CM_Db_Db::execRead("SELECT `id`, `level`, `ipStart` FROM `cm_model_location_ip`\r\n\t\t\tWHERE `ipEnd` >= ?\r\n\t\t\tORDER BY `ipEnd` ASC\r\n\t\t\tLIMIT 1", array($ip))->fetch();
     if ($result) {
         if ($result['ipStart'] <= $ip) {
             return new CM_Model_Location($result['level'], $result['id']);
         }
     }
     return null;
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:14,代码来源:Location.php

示例2: _getAggregationData

    /**
     * @return array
     */
    protected function _getAggregationData()
    {
        $cacheKey = $this->_getCacheKeyAggregation();
        $cache = CM_Cache_Local::getInstance();
        if (false === ($aggregationData = $cache->get($cacheKey))) {
            $conversionData = CM_Db_Db::execRead('
              SELECT COUNT(1) as `conversionCount`, SUM(`conversionWeight`) as `conversionWeight`, SUM(`conversionWeight` * `conversionWeight`) as `conversionWeightSquared`
                FROM `cm_splittestVariation_fixture`
				WHERE `splittestId`=? AND `variationId`=? AND `conversionStamp` IS NOT NULL', array($this->_getSplittestId(), $this->getId()))->fetch();
            $fixtureCount = (int) CM_Db_Db::execRead('SELECT COUNT(1) FROM `cm_splittestVariation_fixture`
				WHERE `splittestId`=? AND `variationId`=?', array($this->_getSplittestId(), $this->getId()))->fetchColumn();
            $aggregationData = array('conversionCount' => (int) $conversionData['conversionCount'], 'conversionWeight' => (double) $conversionData['conversionWeight'], 'conversionWeightSquared' => (double) $conversionData['conversionWeightSquared'], 'fixtureCount' => $fixtureCount);
            $cache->set($cacheKey, $aggregationData, 30);
        }
        return $aggregationData;
    }
开发者ID:aladin1394,项目名称:CM,代码行数:19,代码来源:SplittestVariation.php

示例3: while

<?php

return;
$rows = CM_Db_Db::execRead('SELECT `id`, `thumbnailCount` FROM cm_streamChannel_media WHERE thumbnailCount > 0');
while ($row = $rows->fetch()) {
    CM_Db_Db::exec('UPDATE cm_streamChannel_media SET `data`=? WHERE `id`=? ', [CM_Params::encode(['thumbnailCount' => (int) $row['thumbnailCount']], true), $row['id']]);
}
$rows = CM_Db_Db::execRead('SELECT `id`, `thumbnailCount` FROM cm_streamChannelArchive_media WHERE thumbnailCount > 0');
while ($row = $rows->fetch()) {
    CM_Db_Db::exec('UPDATE cm_streamChannelArchive_media SET `data`=? WHERE `id`=? ', [CM_Params::encode(['thumbnailCount' => (int) $row['thumbnailCount']], true), $row['id']]);
}
开发者ID:cargomedia,项目名称:cm,代码行数:11,代码来源:56.php

示例4: processQueue

 /**
  * @param int $limit
  */
 public static function processQueue($limit)
 {
     $limit = (int) $limit;
     $result = CM_Db_Db::execRead('SELECT * FROM `cm_mail` ORDER BY `createStamp` LIMIT ' . $limit);
     while ($row = $result->fetch()) {
         $mail = new CM_Mail();
         foreach (unserialize($row['to']) as $to) {
             $mail->addTo($to['address'], $to['name']);
         }
         foreach (unserialize($row['replyTo']) as $replyTo) {
             $mail->addReplyTo($replyTo['address'], $replyTo['name']);
         }
         foreach (unserialize($row['cc']) as $cc) {
             $mail->addCc($cc['address'], $cc['name']);
         }
         foreach (unserialize($row['bcc']) as $bcc) {
             $mail->addBcc($bcc['address'], $bcc['name']);
         }
         if ($headerList = unserialize($row['customHeaders'])) {
             foreach ($headerList as $label => $valueList) {
                 foreach ($valueList as $value) {
                     $mail->addCustomHeader($label, $value);
                 }
             }
         }
         $sender = unserialize($row['sender']);
         $mail->setSender($sender['address'], $sender['name']);
         $mail->_send($row['subject'], $row['text'], $row['html']);
         CM_Db_Db::delete('cm_mail', array('id' => $row['id']));
     }
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:34,代码来源:Mail.php


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