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


PHP Repository::findCountFromMood方法代码示例

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


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

示例1: listAction

 function listAction()
 {
     $date_num = array(31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30);
     $infos = SqlRepository::getTagIdCount();
     $tag_infos = array();
     foreach ($infos as $info) {
         $info['tag_name'] = Repository::findTagNameFromTags(array('eq' => array('tag_id' => $info['tag_id'])));
         $tag_infos[] = $info;
     }
     //$first_date = '2013-12-15';
     $dates = array();
     $timestamp = time() - 3600;
     $month_num = (date('Y', $timestamp) - 2013) * 12 + (date('m', $timestamp) - 12) + 1;
     for ($i = 0; $i <= $month_num; $i++) {
         $info = array();
         $y = date('Y', $timestamp);
         $m = date('m', $timestamp);
         $timestamp -= 3600 * 24 * $date_num[$m - 1];
         if ($m == 3 && ($y % 100 == 0 && $y % 400 == 0 || $y % 100 != 0 && $y % 4 == 0)) {
             $timestamp -= 3600;
         }
         $date = $y . '-' . $m;
         $info['id'] = $y . '0' . $m;
         $info['month'] = $date;
         $info['article'] = Repository::findCountFromArticle(array('ge' => array('inserttime' => $date . '-01 00:00:00"'), 'le' => array('inserttime' => $date . '-31 00:00:00"')));
         $info['mood'] = Repository::findCountFromMood(array('ge' => array('inserttime' => $date . '-01 00:00:00"'), 'le' => array('inserttime' => $date . '-31 00:00:00"')));
         $dates[] = $info;
     }
     $params = array('dates' => $dates, 'tags' => $tag_infos, 'tag_count' => count($tag_infos), 'title' => '检索一下', 'category_id' => 1);
     $this->display(__METHOD__, $params);
 }
开发者ID:aleafboat,项目名称:techlog,代码行数:31,代码来源:SearchController.php

示例2: moodAction

 public function moodAction($query_params)
 {
     if (!$this->is_root) {
         header("Location: /index/notfound");
         return;
     }
     $page = (isset($query_params[0]) and intval($query_params[0])) > 0 ? intval($query_params[0]) : 1;
     $count = Repository::findCountFromMood(array());
     $moods = Repository::findFromMood(array('order' => array('inserttime' => 'desc'), 'range' => array(($page - 1) * $this->limit, $this->limit)));
     $params = array('page' => $page, 'base' => '/debin/mood', 'limit' => $this->limit, 'title' => '心情小说', 'ismood' => true, 'method' => __METHOD__, 'article_count' => $count, 'article_infos' => $this->getMoodInfos($moods));
     $this->predisplay($params);
 }
开发者ID:junkings,项目名称:techlog,代码行数:12,代码来源:DebinController.php

示例3: listAction

 public function listAction()
 {
     $labels = array();
     $uv = array();
     $pv = array();
     $timestamp = time();
     for ($i = 0; $i < 14; ++$i) {
         $date = date('Y-m-d', $timestamp - 3600 * 24 * (14 - 1) + $i * 3600 * 24);
         list($total, $date) = SqlRepository::getUVInfos($date);
         $uv[] = $total;
         $labels[] = $date;
     }
     $pv_count = SqlRepository::getPVInfos($timestamp);
     foreach ($pv_count as $pv_info) {
         $pv[] = $pv_info['total'];
     }
     $all_pv = Repository::findCountFromStats();
     $all_uv = RedisRepository::getAllUV();
     $category_infos = SqlRepository::getCategoryInfos();
     $colors = array(array('color' => 'rgba(0, 255, 255, 0.8)', 'light' => 'rgba(220, 220, 220, 0.3)'), array('color' => 'rgba(255, 255, 128, 0.8)', 'light' => 'rgba(220, 220, 220, 0.3)'), array('color' => 'rgba(128, 128, 255, 0.8)', 'light' => 'rgba(220, 220, 220, 0.3)'), array('color' => 'rgba(17, 177, 255, 0.8)', 'light' => 'rgba(220, 220, 220, 0.3)'), array('color' => 'rgba(255, 128, 192, 0.8)', 'light' => 'rgba(220, 220, 220, 0.3)'), array('color' => 'rgba(128, 255, 128, 0.8)', 'light' => 'rgba(220, 220, 220, 0.3)'), array('color' => 'rgba(104, 180, 255, 0.8)', 'light' => 'rgba(220, 220, 220, 0.3)'));
     $category_data = array();
     $temp_infos = array();
     for ($i = 0; $i < count($category_infos); ++$i) {
         $infos = $category_infos[$i];
         $temp_infos['label'] = $infos['category'];
         $temp_infos['value'] = intval($infos['total']);
         $temp_infos['color'] = $colors[$i]['color'];
         $temp_infos['highlight'] = $colors[$i]['light'];
         $category_data[] = $temp_infos;
     }
     $category_data[] = array('label' => '心情小说', 'value' => intval(Repository::findCountFromMood()), 'color' => $colors[count($colors) - 1]['color'], 'highlight' => $colors[count($colors) - 1]['light']);
     $category_infos = SqlRepository::getCategoryNewArticle();
     $category_ids = array('龙潭书斋' => 1, '读书笔记' => 2, '龙渊阁记' => 3, '技术分享' => 4);
     if ($this->is_root) {
         $category_ids['龙泉日记'] = 5;
         $category_ids['龙泉财报'] = 6;
         $category_ids['心情小说'] = 'mood';
     }
     $params = array('all_pv' => $all_pv, 'all_uv' => $all_uv, 'today_pv' => $pv[13], 'today_uv' => $uv[13], 'category_infos' => $category_infos, 'category_ids' => json_encode($category_ids), 'pv' => json_encode($pv), 'uv' => json_encode($uv), 'labels' => json_encode($labels), 'category_data' => json_encode($category_data), 'title' => '数据统计');
     $this->display(__METHOD__, $params);
 }
开发者ID:aleafboat,项目名称:techlog,代码行数:41,代码来源:InfosController.php


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