<?php
namespace app\admin\controller;
use think\Controller;
use think\Db;
use Think\Config;
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2021 http://guojicms.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: 作者@梦雨 <50361804@qq.com>
// +----------------------------------------------------------------------
class Content extends Common
{

    //内容
    public function index()
    {
        hook('phpadmincontenta');
        //权限
        if (socha(user('tid'), 38) != 1) {
            $this->error('权限不足');
        }
        return md5Qm();
    }
    //添加编辑
    public function add()
    {
        hook('phpadmincontentb');
        //权限
        if (socha(user('tid'), 39) != 1) {
            $this->error('权限不足');
        }
		$c=Db::name('html')->find(get('id',0));
        $this->assign('c',$c);
        if(config_m(muban(),'admin_add')){
            return md5Qm(config_m(muban(),'admin_add'));
        } else {
            return md5Qm();
        }
    }
    //评论管理
    public function comment()
    {
        hook('phpadmincontentc');
        //权限
        if (socha(user('tid'), 40) != 1) {
            $this->error('权限不足');
        }
        return md5Qm();
    }
    //评论查看
    public function comment_add()
    {
        hook('phpadmincontentd');
		$c=Db::name('comment')->find(input('id'));
        $this->assign('c',$c);
        return md5Qm();
    }
}