<?php

namespace app\index\controller;

use app\common\controller\Frontend;
use think\Db;
class Index extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = '';

    public function index()
    {
    	
    	$this->view->assign('title', __('微版本'));

    	$windsns_links = Db::name('links')->where(['links_state'=>1])-> order('linksid', 'desc')->paginate(20); 
        $page = $windsns_links->render();
    	$this->assign('windsns_links', $windsns_links);
    	$windsns_users = Db::name('user')-> order('id', 'desc')->paginate(34); 
        $page = $windsns_users->render();
    	$this->assign('windsns_users', $windsns_users);
    	
    		$pcswiper_banner = Db::name('banner')
			          ->where('banner_weizhi', 1)
			          ->where('banner_state', 1)
			          ->select();
           $this->assign('pcswiper_banner', $pcswiper_banner);

    	$windsnsarticlelists = Db::name('article')->alias('a')->join('ws_article_type w','a.article_type = w.article_typeid')-> where(['article_state'=>1])-> order('articleid', 'desc')->paginate(20); //资讯列表
        $page = $windsnsarticlelists->render();
    	$this->assign('windsnsarticlelists', $windsnsarticlelists);
        $this->assign('page', $page);
    	
    	$windsnsvideoslist = Db::name('admin_videos')->
		alias('a')->join('ws_admin_videostype w','a.videos_fenleiid = w.video_typeid') ->
		where(['videos_opentype'=>1]) -> 
		order('videosid', 'desc')->paginate(16);
		$page = $windsnsvideoslist->render();
		$this->assign('windsnsvideoslist', $windsnsvideoslist);
		$this->assign('page', $page);
    	
    	$windsnsactivitieslists = Db::name('windsnsactivity')-> where(['windsnsactivityhot'=>2])-> order('windsnsactivityid', 'desc')->paginate(3); //活动列表
        $page = $windsnsactivitieslists->render();
    	$this->assign('windsnsactivitieslists', $windsnsactivitieslists);
        $this->assign('page', $page);

    	
        return $this->view->fetch();
    }

 
 
 
 
 

}
