12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- // +----------------------------------------------------------------------
- // | ThinkAdmin
- // +----------------------------------------------------------------------
- // | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
- // +----------------------------------------------------------------------
- // | 官方网站: https://thinkadmin.top
- // +----------------------------------------------------------------------
- // | 开源协议 ( https://mit-license.org )
- // | 免费声明 ( https://thinkadmin.top/disclaimer )
- // +----------------------------------------------------------------------
- // | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
- // | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
- // +----------------------------------------------------------------------
- namespace app\admin\controller;
- use app\data\model\DataPoolTalent;
- use app\data\model\DataTeachingKnowledge;
- use app\data\model\DataZhicheng;
- use Carbon\Carbon;
- use think\admin\Controller;
- use think\admin\model\SystemUser;
- use think\db\Query;
- /**
- * 知识教学管理
- * Class PoolTalent
- * @package app\admin\controller
- */
- class TeachingKnowledgeAuth extends Controller
- {
- /**
- * 知识教学申请管理
- * @auth true
- * @menu true
- */
- public function index(){
- $this->title='知识教学申请列表';
- $name=input('name');
- DataTeachingKnowledge::mQuery()
- ->when($name,function (Query $query) use ($name) {
- $query->hasWhere('user',function (Query $query) use ($name) {
- $query->whereLike('nickname',"%{$name}%");
- });
- })
- ->with(['user'])
- ->where('type',2)
- ->where('is_del',1)
- ->order('id','desc')
- ->layTable();
- }
- protected function _index_page_filter(&$data)
- {
- }
- /**
- * 知识教学审核
- * @auth true
- * @menu true
- */
- public function audit($id){
- $this->title='知识教学审核';
- $row=DataTeachingKnowledge::mk()->findOrFail($id);
- if($this->request->isGet()){
- $this->assign('row',$row);
- $this->fetch();
- }else{
- if($row['audit']>1){
- $this->error('该记录已审核');
- }
- $data=$this->_vali([
- 'audit.require'=>'结果必须',
- 'audit.in:2,3'=>'结果有误',
- 'why.requireIf:audit,3'=>'原因必须',
- 'why.max:200'=>'原因有误',
- ]);
- $row['audit']=$data['audit'];
- $row['why']=$data['why']??'';
- $row['audit_at']=Carbon::now();
- $row->save();
- $this->success('审核成功');
- }
- }
- /**
- * 删除
- * @auth true
- * @menu true
- */
- public function del($id){
- DataTeachingKnowledge::whereIn('id',$id)->save([
- 'is_del'=>0,
- ]);
- $this->success('删除成功');
- }
- }
|