private function GetArticleList($page = '') { //检索 $where = strip_tags(htmlspecialchars_decode(I('session.Article_SqlCondition_Str'))); //排序 $order = GetQueryOrder(I('session.Article_orderField', "article_id"), I('session.Article_orderDirection', "desc")); //分页 $total = intval($this->ArticleModel->where($where)->count()); //总数 $limit = GetQueryPage(I('session.Article_pageCurrent', 1), I('session.Article_pageSize', 10)); //数据 $ArticleList = $this->ArticleModel->where($where)->order($order)->limit($limit['limit'])->select(); $return = array("Page" => array("total" => $total, "current" => $limit['current'], "size" => $limit['size'], "limit" => $limit['limit']), "ArticleList" => $ArticleList); return $return; }
public function GetUserCateList($isformat = true) { if ($isformat) { //检索 $where = strip_tags(htmlspecialchars_decode(session('UserCategory_SqlCondition_Str'))); //排序 $order = GetQueryOrder(I('session.UserCategory_orderField', "usercate_id"), I('session.UserCategory_orderDirection', "desc")); //分页 $total = intval($this->UserCateModel->where($where)->count()); //总数 $limit = GetQueryPage(I('session.UserCategory_pageCurrent', 1), I('session.UserCategory_pageSize', 10)); } $data = $this->UserCateModel->where($where)->order($order)->limit($limit['limit'])->select(); $return = array("Page" => array("total" => $total, "current" => $limit['current'], "size" => $limit['size'], "limit" => $limit['limit']), "UserCateList" => $data); return $return; }
public function GetArticleCateList($isformat = true) { //检索 if ($isformat) { $where = strip_tags(htmlspecialchars_decode(I('session.ArticleTag_SqlCondition_Str'))); } //排序 if ($isformat) { $order = GetQueryOrder(I('session.ArticleTag_orderField', "tag_id"), I('session.ArticleTag_orderDirection', "desc")); //$order = "articlecate_id desc"; } //分页 if ($isformat) { $total = intval($this->ArticleTagModel->where($where)->count()); //总数 if (empty($where)) { $limit = GetQueryPage(I('session.ArticleTag_pageCurrent', 1), I('session.ArticleTag_pageSize', 10)); } else { $limit = GetQueryPage(1, 10); } } //数据 $ArticleCateList = $this->ArticleTagModel->where($where)->order($order)->limit($limit['limit'])->select(); $return = array("Page" => array("total" => $total, "current" => $limit['current'], "size" => $limit['size'], "limit" => $limit['limit']), "ArticleTag" => $ArticleCateList); return $return; }