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; } }