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


PHP Statistics::model方法代码示例

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


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

示例1: loadModel

 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Statistics::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
开发者ID:yunsite,项目名称:my-advertise,代码行数:13,代码来源:StatisticsController.php

示例2: actionVisitEnd

 /**
  * 访问结束时更新相关数据
  * Enter description here ...
  */
 public function actionVisitEnd()
 {
     UtilHelper::writeToFile($_GET);
     $id = $_GET['id'];
     $aid = $_GET['aid'];
     $model = $this->loadModel($aid);
     try {
         $model->online--;
         if ($model->save()) {
             echo "YES";
         } else {
             UtilHelper::writeToFile(CHtml::errorSummary($model), 'a+');
         }
     } catch (Exception $e) {
         echo $e->getFile() . $e->getLine() . $e->getMessage();
     }
     Statistics::model()->VisitEnd($id);
 }
开发者ID:yunsite,项目名称:my-advertise,代码行数:22,代码来源:InfoController.php

示例3: agentStatistics

 public function agentStatistics()
 {
     $result = array();
     $model = Statistics::model()->findAll();
     foreach ($model as $data) {
         $agent = $data->terminal;
         $browser = new Browser();
         $browser->setUserAgent($agent);
         $browserinfo = str_replace(array(' ', '.'), array('_', '-'), $browser->getBrowser());
         $version = str_replace(array(' ', '.'), array('_', '-'), $browser->getVersion());
         $platform = str_replace(array(' ', '.'), array('_', '-'), $browser->getPlatform());
         //			$aolversion = str_replace(array(' ','.'), array('_','-'),$browser->getAolVersion());
         $result['Agent'][$browserinfo][$version] += 1;
         $result['Platform'][$platform] += 1;
     }
     return $result;
 }
开发者ID:yunsite,项目名称:my-advertise,代码行数:17,代码来源:Statistics.php

示例4: array

		<!-- JiaThis Button BEGIN -->
		<div id="ckepop">
			<span class="jiathis_txt">分享到:</span>
			<a class="jiathis_button_tools_1"></a>
			<a class="jiathis_button_tools_2"></a>
			<a class="jiathis_button_tools_3"></a>
			<a class="jiathis_button_tools_4"></a>
			<a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank">更多</a>
			<a class="jiathis_counter_style"></a>
		</div>
		<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
		<!-- JiaThis Button END -->
				
		<hr class="space" />
		<?php 
$this->widget('ext.links.prenext.PreNextWidget', array('id' => $model->id));
?>
		<hr class="space" />
		<div id="friends_view">
			
		</div>
		<?php 
$ids = Statistics::model()->historyViewStatistics($model);
?>
		
	</div>
	<hr class="space" />
	<br />	
</section>
<?php 
$this->widget('ext.syntaxhighlighter.syntaxhighlighterWidget');
开发者ID:yunsite,项目名称:my-advertise,代码行数:31,代码来源:view.php

示例5: actionStatistics

 /**
  * 统计
  *
  * @param string $action
  * @param string $view
  * @param string $timestamp   //2014-03-10 12:12:12
  * @param int    $user_id*
  * @param string $target_id*
  * @param string $result*
  */
 public function actionStatistics()
 {
     // 参数检查
     if (empty($_REQUEST['action']) || empty($_REQUEST['view']) || empty($_REQUEST['timestamp'])) {
         $this->_return('MSG_ERR_LESS_PARAM');
     }
     $action = trim(Yii::app()->request->getParam('action'));
     $view = trim(Yii::app()->request->getParam('view'));
     $timestamp = trim(Yii::app()->request->getParam('timestamp'));
     $user_id = trim(Yii::app()->request->getParam('user_id'));
     $target_id = trim(Yii::app()->request->getParam('target_id'));
     $result = trim(Yii::app()->request->getParam('result'));
     $time = strtotime($timestamp);
     //传入时间不能转换城时间戳返回参数错误
     if ($time === false) {
         $this->_return('MSG_ERR_FAIL_PARAM');
     }
     if (!is_numeric($user_id)) {
         $user_id = 0;
     }
     $year = date('Y', $time);
     $month = date('m', $time);
     $day = date('d', $time);
     $param = array('action' => $action, 'view' => $view, 'timestamp' => $timestamp, 'user_id' => $user_id, 'target_id' => $target_id, 'result' => $result, 'year' => $year, 'month' => $month, 'day' => $day, 'version' => $GLOBALS['__VERSION'], 'device_id' => $GLOBALS['__DEVICEID'], 'platform' => $GLOBALS['__PLATFORM'], 'channel' => $GLOBALS['__CHANNEL'], 'app_version' => $GLOBALS['__APPVERSION'], 'os_version' => $GLOBALS['__OSVERSION'], 'app_id' => $GLOBALS['__APPID'], 'ip' => $GLOBALS['__IP']);
     try {
         Statistics::model()->push($time, $param);
     } catch (Exception $e) {
         error_log($e);
         $this->_return('MSG_ERR_UNKOWN');
     }
     return $this->_return('MSG_SUCCESS');
 }
开发者ID:hucongyang,项目名称:goddess,代码行数:42,代码来源:CommonController.php


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