Talent.php 1.6 KB
<?php


namespace app\index\controller;


use app\admin\model\Style;
use app\common\controller\Frontend;
use think\Request;

class Talent extends Frontend
{
    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = '';
    public function index()
    {
        $param=Request::instance()->param();
        $menu=self::$model::menu(12);
        $list=self::$model::talent($param['pid'],10);
        $this->assign("left",$menu);
        $this->assign("list",$list);
        return $this->view->fetch();
    }
    public function detail()
    {
        $param=Request::instance()->param();
        $news=\app\admin\model\Talent::where($param)->where("status",1)->find();
        $this->assign("news",$news);
        return $this->view->fetch();
    }
    public function initiate_1()
    {
        $param=Request::instance()->param();
        if(Request::instance()->isPost()){
            $param['status']=2;
            $res=\app\admin\model\Talent::create($param);
            return self::$model::js("提交成功",200);
        }
        $style=Style::where("style",$param['style'])->select();
        $this->assign("style",$style);
        return $this->view->fetch();
    }
    public function initiate_2()
    {
        $param=Request::instance()->param();
        if(Request::instance()->isPost()){
            $param['status']=2;
            $res=\app\admin\model\Talent::create($param);
            return self::$model::js("提交成功",200);
        }
        $style=Style::where("style",$param['style'])->select();
        $this->assign("style",$style);
        return $this->view->fetch();
    }
}