<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
/*
首页等页面
*/
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2020 http://myucms.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: 梦雨 <50361804@qq.com>
// +----------------------------------------------------------------------
class Index extends Controller
{
    //首页
    public function index()
    {
    	
        return view();
    }
	//列表
    public function lists()
    {
		$c=Db::name('cate')->where(array('alias'=>input('alias'),'open' => 1))->find();
        $this->assign('c',$c);
        return view();
    }
	//详情
    public function html()
    {
    	
		$c=Db::name('article')->where(array('id'=>input('id'),'open'=>1))->find();
        $this->assign('c',$c);
        if (empty($c['id'])) {
            return $this->error('页面不存在');
        }
        Db::name('article')->where('id', input('id'))->setInc('view', 1);
        return view();
    }
    //联系我们
    public function contact()
    {
         return view();
    }
    //单页
    public function dan()
    {
        $dan = Db::name('dan');
        $c = $dan->where(array('alias' => input('alias'),'open' => 1))->find();   
        $this->assign('c',$c);
        if (empty($c['id'])) {
            return $this->error('页面不存在');
        }
        return view('application/index/view/dan/'.$c['muban']);
    }
}