<?php
namespace app\admin\controller;
use QL\QueryList;
use WordAnalysis\Analysis;
use think\Controller;
use think\Db;
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2021 http://guojicms.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: 作者@梦雨 <50361804@qq.com>
// +----------------------------------------------------------------------
class Com extends Common
{
	//前台导航
    public function link_index()
    {
        hook('phpadmincoma');
        return md5Qm();
    }
	//友情链接
    public function link_youqing()
    {
        hook('phpadmincomb');
        return md5Qm();
    }
	//添加编辑链接
    public function link_add()
    {
        hook('phpadmincomc');
        $c=Db::name('link')->where(array('id' => get('id',0)))->find();
        $this->assign('c',$c);
        return md5Qm();
    }
	//前台会员
    public function member()
    {
        hook('phpadmincomd');
    	$ks = input('ks');
    	$html = Db::name('member')->order('userid desc')->where('phone|username|userid', 'like', '%' . $ks . '%')->paginate(15, false, $config = ['query' => array('ks' => $ks)]);
		$this->assign('html', $html);
        return md5Qm();
    }
	//添加编辑会员
    public function member_add()
    {
        hook('phpadmincome');
		$c=Db::name('member')->where(array('userid' => input('id')))->find();
        $this->assign('c',$c);
        return md5Qm();
    }
	//文件管理
    public function file()
    {
        hook('phpadmincomf');
		return md5Qm();
    }
    //验证码
    public function yanzhengma()
    {
        hook('phpadmincomg');
        //权限
        if (socha(user('tid'), 28) != 1) {
            $this->error('权限不足');
        }
		return md5Qm();
    }
    //单页管理
    public function dan()
    {
        hook('phpadmincomh');
        //权限
        if (socha(user('tid'), 29) != 1) {
            $this->error('权限不足');
        }
        return md5Qm();
    }
    //积分记录
    public function jifen()
    {
        hook('phpadmincomi');
        //权限
        if (socha(user('tid'), 30) != 1) {
            $this->error('权限不足');
        }
        return md5Qm();
    }
    //提现记录
    public function tixian()
    {
        hook('phpadmincomj');
        //权限
        if (socha(user('tid'), 31) != 1) {
            $this->error('权限不足');
        }
        return md5Qm();
    }
    //单页添加编辑
    public function dan_add()
    {
        hook('phpadmincomk');
        //权限
        if (socha(user('tid'), 32) != 1) {
            $this->error('权限不足');
        }
        $c=Db::name('dan')->where(array('id' => get('id',0)))->find();
        $this->assign('c',$c);
        return md5Qm();
    }
    //分类首页
    public function cate_index()
    {
        hook('phpadmincoml');
        //权限
        if (socha(user('tid'), 33) != 1) {
            $this->error('权限不足');
        }
        return md5Qm();
    }
    //分类添加编辑
    public function cate_add()
    {
        hook('phpadmincomm');
        //权限
        if (socha(user('tid'), 34) != 1) {
            $this->error('权限不足');
        }
        $c=Db::name('cate')->where(array('id' => get('id',0)))->find();
        $this->assign('c',$c);
        return view();
    }
    //主题模板
     public function muban()
    {
        hook('phpadmincomn');
        //权限
        if (socha(user('tid'), 27) != 1) {
            $this->error('权限不足');
        }
        return md5Qm();
    }
    // 模板设置
    public function muban_config()
    {
        hook('phpadmincomo');
        //权限
        if (socha(user('tid'), 26) != 1) {
            $this->error('权限不足');
        }
        return view();
    }
    // 广告
    public function ad()
    {
        hook('phpadmincomp');
        //权限
        if (socha(user('tid'), 35) != 1) {
            $this->error('权限不足');
        }
        return md5Qm();
    }
    //插件中心
     public function addons()
    {
        hook('phpadmincomq');
        //权限
        if (socha(user('tid'), 25) != 1) {
            $this->error('权限不足');
        }
        return md5Qm();
    }
    // 插件设置
    public function addons_config()
    {
        hook('phpadmincoml');
        //权限
        if (socha(user('tid'), 24) != 1) {
            $this->error('权限不足');
        }
        return view();
    }
}
