<?php

namespace app\index\controller;

class Index extends Common {

    public function _initialize()
    {
        parent::_initialize(); // TODO: Change the autogenerated stub
    }

    public function index()
    {
        //推荐文章
        $recommend_list=model('article')->indexGetArticleToIsRecommend();
        //最新文章
        $new_list=model('article')->indexGetArticleToOrder([],['create_time','desc']);
        //热门文章
        $hot_list=model('article')->indexGetArticleToOrder([],['hits','desc']);

        $data = model('article')->indexGetArticleData();
        $this->assign('recommend_list',$recommend_list);
        $this->assign('new_list',$new_list);
        $this->assign('hot_list',$hot_list);

        $this->assign('data',$data);
        $this->assign('page',$data->render());
        return $this->fetch();
    }

}