本文整理汇总了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);
}
示例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);
}
示例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);
}