Example #1
0
 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;
 }
Example #2
0
 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'];
 }