public function index() { $article = new ArticleModel(); $comment = new CommentModel(); $commentuser = new CommentuserModel(); //合计评论用户数 $this->totalUser = $commentuser->getCount(); //文章合计 $this->totalArticle = $article->getCount(); //评论合计 $this->totalComment = $comment->getCount(); //今日新增 $this->todayArticle = $article->getCount(' `createtime` > ' . $this->formatTime(time(), '1')); $this->todayComment = $comment->getCount(' `comment_time` > ' . $this->formatTime(time(), '1')); //昨日新增 $this->yesArticle = $article->getCount(' `createtime` > ' . $this->formatTime(time() - 24 * 60 * 60, '1') . ' AND createtime < ' . $this->formatTime(time() - 24 * 60 * 60, '2')); $this->yesComment = $comment->getCount(' `comment_time` > ' . $this->formatTime(time() - 24 * 60 * 60, '1') . ' AND comment_time < ' . $this->formatTime(time() - 24 * 60 * 60, '2')); //热门文章输出 $data = $article->getArticle('web_article.clicked', array(0, 10)); // foreach($data as $key=>$v){ // $data[$key]['commentinfo'] = count($data[$key]['commentinfo']); // } $this->data = $data; //活跃用户 $userList = $comment->getHotUser(); $this->userList = $userList; $this->display("Index/index.tpl"); }
public function userComment() { $commentUser = new CommentuserModel(); $count = $commentUser->getCount(); $p = !empty($_GET['p']) ? $_GET['p'] : 1; if ($p < 1 || $p > ceil($count / $this->pageNum)) { $this->display("Error/index.tpl"); exit; } $this->commentUser = $commentUser->getUser(array(($p - 1) * $this->pageNum, $this->pageNum)); $page = new Page(); $this->show = $page->getPage(APP . '/Admin/User/usercomment/p/', $count, $this->pageNum, $p); $this->ps = ($p - 1) * $this->pageNum + 1; $this->display('User/usercomment.tpl'); }