public function preform() { $DaoFenlei = new DaoFenlei(); $result = $DaoFenlei->getFenleiInfo(); $limit = 7; $pageInfo = Tools::_pageInfo($this->params['safe']['page'], count($result), $limit); if (is_array($result)) { $result = array_slice($result, $pageInfo['start'], $pageInfo['limit']); //10 } $this->result['data']['list'] = $result; $DaoFenlei->getFenleiCount() / $limit > 1 ? $this->result['count'] = 1 : ($this->result['count'] = $DaoFenlei->getFenleiCount() / $limit); $this->result['page'] = $this->params['safe']['page']; }
public function preform() { // echo "WebSiteSittingModel.class.php"; $DaoUser = new DaoUser(); $result = $DaoUser->getUser(); $limit = 7; $pageInfo = Tools::_pageInfo($this->params['safe']['page'], count($result), $limit); if (is_array($result)) { $result = array_slice($result, $pageInfo['start'], $pageInfo['limit']); //10 } $this->result['data']['list'] = $result; $this->result['count'] = $DaoUser->getUserCount() / $limit; $this->result['page'] = $this->params['safe']['page']; }
public function preform() { $DaoArticle = new DaoArticle(); $result = $DaoArticle->getArticleByFenlei($this->result['params']['safe']['fenleiId'] ? $this->result['params']['safe']['fenleiId'] : 1); $pageInfo = Tools::_pageInfo($this->params['safe']['page'], count($result), $limit = 5); if (is_array($result)) { $result = array_slice($result, $pageInfo['start'], $pageInfo['limit']); //10 } if (empty($result)) { $this->result['data']['list'] = array('code' => 0); } else { $this->result['data']['list'] = $result; $this->result['pageInfo'] = $pageInfo; } }
public function preform() { $DaoBlog = new DaoArticle(); $list = $DaoBlog->getBlogList(); $pageInfo = Tools::_pageInfo($this->params['safe']['page'], count($list), $limit = 10); //============= if (is_array($list)) { $list = array_slice($list, $pageInfo['start'], $pageInfo['limit']); //10 } $DaoUser = new DaoUser(); $hot_user = $DaoUser->getUser(); $this->result['hot_user'] = $hot_user; $this->result['data']['list'] = $list; $this->result['pageInfo'] = $pageInfo; }
public function preform() { // echo "WebSiteSittingModel.class.php"; $DaoArticle = new DaoArticle(); $result = $DaoArticle->getArticleByUser(); $ret = $DaoArticle->getBlogList(); $DaoUser = new DaoUser(); $limit = 7; $pageInfo = Tools::_pageInfo($this->params['safe']['page'], count($result), $limit); if (is_array($result)) { $result = array_slice($result, $pageInfo['start'], $pageInfo['limit']); //10 } //print_r($ret); $this->result['data']['list'] = $result; $DaoArticle->getArticleCount() / $limit > 1 ? $this->result['count'] = 1 : ($this->result['count'] = $DaoArticle->getArticleCount() / $limit); $this->result['page'] = $this->params['safe']['page']; }