title='招聘信息列表'; $name=input('title'); DataRecruitment::mQuery() ->when($name,function (Query $query) use ($name) { $query->hasWhere('shipyard',function (Query $query) use ($name) { $query->whereLike('name',"%{$name}%"); }); }) ->where($admin_id) ->where('is_del',1) ->with(['datauser','shipyard']) ->order('id','desc') ->layTable(); } protected function _index_page_filter(&$data) { // dump($data);die; } /** * 招聘信息添加 * @auth true * @menu true */ public function add(){ DataRecruitment::mForm('form'); } /** * 招聘信息编辑 * @auth true * @menu true */ public function edit(){ DataRecruitment::mForm('form'); } /** * 表单结果处理 * @param boolean $result * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ protected function _form_result(bool $result) { if ($result && $this->request->isPost()) { // GoodsService::stock(input('code')); $this->success('恭喜,数据保存成功!', 'javascript:history.back()'); } } public function _form_filter($vo){ if ($this->request->isGet()) { }elseif ($this->request->isPost()){ } } /** * 招聘信息查看 * @auth true * @menu true */ public function audit($id){ $this->title='招聘信息查看'; $row=DataRecruitment::mk() ->with(['datauser','shipyard']) ->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(); if ($data['audit']==2){ DataUser::mk()->where('id',$row['uuid'])->update(['is_maintenance'=>1]); } $this->success('审核成功'); } } public function collection(){ $where = []; $data = input(); if(isset($data['link_id'])){ $where['a.link_id'] = $data['link_id']; } $this->title='感兴趣用户列表'; $name=input('title'); DataCollectionLog::mQuery()->alias('a') ->field('a.*,b.id uid,b.nickname,b.phone,b.base_sex') ->join('data_user b','b.id=a.uuid') ->where('a.type',3)->where($where)->order('a.id','desc') ->page(); } }