smsService = $smsService; } /** * 招考报名首页 * @param Content $content * @return Content */ public function index(Content $content) { return $content ->header('招考报名管理') ->description('') ->body($this->grid()); } /** * 新增招考报名表单页. * * @param Content $content * @return Content */ public function create(Content $content) { Permission::check('recruit_manager_create'); return $content ->header('新增招聘场次') ->description('新增') ->body(view('admin.recruit.index')->with(['grid' => $this->form()->render(), 'id' => '0'])); } /** * Edit interface. * * @param mixed $id * @param Content $content * @return Content */ public function edit($id, Content $content) { Permission::check('recruit_manager_edit'); $grid = $this->form()->edit($id)->render(); return $content ->header('招考管理') ->description('编辑') ->body(view('admin.recruit.index')->with(['grid' => $grid, 'id' => $id])); } /** * Show interface. * * @param mixed $id * @param Content $content * @return Content */ public function show($id, Content $content) { return redirect('/ST3IXxKlOa4eGEv0eTw0CfORI9444Mgj/recruit/index'); } public function detail($id) { $show = new Show(Recruit::findOrFail($id)); // $recruit = Recruit::findOrFail($id); $show->title('标题'); $show->created_at('创建时间'); return $show; } /** * 获得招考场次的岗位 * @param Request $request * @return \Illuminate\Http\JsonResponse */ public function getRecruitPost(Request $request) { $id = $request->id; $recruit = Recruit::find($id); $post = RecruitPost::where('recruit_id', $id)->get(); return response()->json(['post' => $post, 'recruit' => $recruit], '200'); } /** * Make a grid builder. * * @return Grid */ protected function grid() { $grid = new Grid(new Recruit); $grid->model()->orderBy('created_at', 'DESC'); $grid->model()->paginate(20); if (Admin::user()->can('recruit_manager_create')) { $grid->disableCreateButton(false); } $grid->perPages([10, 20, 30, 40, 50, 100]); $grid->id('ID'); $grid->name('招考场次名称'); $grid->column('current','当前阶段')->display(function ($current) { switch ($current){ case '1': return '报名'; break; case '2': return '审核'; break; case '3': return '笔试'; break; case '4': return '上机测试'; break; case '5': return '面试'; break; case '6': return '复试'; break; case '7': return '体检'; break; case '8': return '政审'; break; case '9': return '公示'; break; case '0': return '已结束'; break; } }); $grid->column('status','状态')->display(function ($status) { return $status ? '显示' : '隐藏'; }); $grid->filter(function ($filter) { $filter->disableIdFilter(); $filter->where(function ($query) { $query->where('simple', '=', "{$this->input}"); }, '类型', 'simple')->radio([0 => '招考',1 => '招聘']); }); $grid->created_at('创建时间'); $grid->actions(function ($actions) { $actions->append('报名管理'); $actions->disableEdit(false); $actions->disableDelete(false); $actions->disableView(); }); return $grid; } /** * 新增/修改招考场次的表单 * * @return Form */ protected function form() { $form = new ValidateForm(new Recruit); $form->tab('基础信息', function ($form) { $form->text('name', '招考场次名称')->rules('required|between:4,61', [ 'required' => '请填写招考场次名称', 'between' => '招考场次名称长度为2~30个字符' ])->setWidth(5)->setMustMark(); $form->text('company', '招聘主体')->rules('required|between:4,61', [ 'required' => '请填写招聘主体', 'between' => '招聘主体长度为2~30个字符' ])->setWidth(5)->setMustMark(); $form->text('name_en', '英文标识')->setWidth(5)->help('同一个招聘单位,发布的招聘场次若不在同一天,允许一样,若为空则自动生成'); $form->image('small_img', '缩略图')->uniqueName()->setWidth(3); $form->radio('simple', '类型')->options([0 => '招聘', 1 => '招考'])->default(0)->setMustMark(); $form->switch('status', '状态')->default(1)->setMustMark(); $form->switch('show_report', '显示报名人数')->default(0)->setMustMark(); $form->radio('current', '当前进展')->options([1 => '报名', 2 => '审核', 3 => '笔试', 4 => '上机测试', 5 => '面试', 6 => '复试', 7 => '体检', 8 => '政审', 9 => '公示',0 => '已结束'])->default(1)->setMustMark(); $form->checkbox('step', '招考流程')->options([1 => '报名', 2 => '审核', 3 => '笔试', 4 => '上机测试', 5 => '面试', 6 => '复试', 7 => '体检', 8 => '政审', 9 => '公示'])->default([1, 2])->setMustMark(); $form->datetimeRange('apply_start', 'apply_end', '报名日期')->rules('required', array('required' => '报名日期必须设置'))->setMustMark(); $form->datetimeRange('audit_start', 'audit_end', '审核日期'); $form->datetimeRange('preliminary_start', 'preliminary_end', '笔试时间'); $form->datetimeRange('computer_start', 'computer_end', '上机时间'); $form->datetimeRange('interview_start', 'interview_end', '面试时间'); $form->datetimeRange('reexamine_start', 'reexamine_end', '复试时间'); $form->datetimeRange('health_start', 'health_end', '体检时间'); $form->datetimeRange('political_start', 'political_end', '政审时间'); $form->datetimeRange('publicity_start', 'publicity_end', '公示时间'); $form->editor('introduction', '招考正文')->rules('required', array('required' => '招考正文不能为空。'))->setMustMark(); $form->text('contact', '联系人'); $form->text('phone', '联系电话'); $form->text('host_address', '联系地址'); //$form->switch('predetermined_status', '是否允许报名')->states($display_option)->default(1)->setMustMark(); $form->number('ordid', '排序')->default(0); $form->multipleFile('addFile', '附件')->move('storage/app/public/recruit/' . time()); })->tab('报名表单与条件', function ($form) { $form->checkbox('forms', '报名表单模块')->options(['basic' => '基础信息模块','expand_special' => '扩展模块-加分','detail' => '详情介绍模块','identification' => '身份证明上传模块','education_certification' => '学历证明上传模块','other_certification' => '其他证明上传模块', 'remark' => '备注模块','internship' => '实习专场'])->default(['basic'])->setMustMark(); $form->text('limit_times', '报名次数限制')->rules('required|regex:/^\d+$/', [ 'required' => '报名限制次数必须填写', 'regex' => '次数必须为数字' ])->default(1)->help('同一个场次允许同时报名几个岗位,直接输入数字即可'); $form->text('post_times', '审核次数限制')->rules('required|regex:/^\d+$/', [ 'required' => '审核限制次数必须填写', 'regex' => '次数必须为数字' ])->default(1)->help('允许提交审核的次数,直接输入数字即可'); $form->datetimeRange('supplement_start', 'supplement_end', '材料补登时间'); $form->radio('pay_switch', '缴费报名')->options([0 => '否', 1 => '是'])->default(0); $form->radio('special_condition_type', '加分条件样式')->options([0 => '手输', 1 => '下拉选择'])->default(0); $form->text('special_condition_value', '加分条件值')->default("")->help('下拉选择项请用英文,隔开'); })->tab('笔试', function ($form) { $form->switch('pen_comfirm', '笔试确认')->help("打开后将会在设置时间段内开启笔试确认功能,有且仅当确认了才能打印准考证参加笔试")->default(0)->setMustMark(); $form->datetimeRange('pen_comfirm_start', 'pen_comfirm_end', '确认笔试时间')->help("设置该时间后,仅在该时间段内才可以确认参加笔试"); $form->radio('pen_ticket_type', '准考证类型')->options([-1 => '不需要',1 => '纸质', 2 => '短信', 3 => '模板'])->default(-1); $form->text('pen_ticket_content', '准考证内容')->help('当类型为纸质时,此处填入准考证模板的路径,当类型为短信时,此处填入短信标识,当类型为模板时,输入模板ID'); $form->listbox('pen_ticket_field', '模板字段')->options(RecruitTicketField::ticketFieldData('pen'))->attribute('hight', '200px')->help('仅纸质准考证需要,非ex开头的字段将自动渲染'); $form->switch('pen_epidemic', '两码上传')->help("下列依赖两码设置,须此项打开才可生效")->default(0)->setMustMark(); $form->switch('pen_health', '健康状态')->help('当两码上传打开且该选项打开时,打印准考证必须通过两码审核')->default(0)->setMustMark(); $form->datetimeRange('pen_health_start', 'pen_health_end', '两码时间')->help("设置该时间后,仅在该时间段内上传该时段内的两码截图才可以"); })->tab('上机', function ($form) { $form->radio('computer_ticket_type', '准考证类型')->options([-1 => '不需要',1 => '纸质', 2 => '短信', 3 => '模板'])->default(-1); $form->text('computer_ticket_content', '准考证内容')->help('当类型为纸质时,此处填入准考证模板的路径,当类型为短信时,此处填入短信标识,当类型为模板时,输入模板ID'); $form->listbox('computer_ticket_field', '模板字段')->options(RecruitTicketField::ticketFieldData('computer'))->attribute('hight', '200px')->help('仅纸质准考证需要,非ex开头的字段将自动渲染'); $form->switch('computer_epidemic', '两码上传')->help("下列依赖两码设置,须此项打开才可生效")->default(0)->setMustMark(); $form->switch('computer_health', '健康状态')->help('当两码上传打开且该选项打开时,打印准考证必须通过两码审核')->default(0)->setMustMark(); $form->datetimeRange('computer_health_start', 'computer_health_end', '两码时间')->help("设置该时间后,仅在该时间段内上传该时段内的两码截图才可以"); })->tab('面试', function ($form) { $form->radio('face_ticket_type', '准考证类型')->options([-1 => '不需要',1 => '纸质', 2 => '短信', 3 => '模板'])->default(-1); $form->text('face_ticket_content', '准考证内容')->help('当类型为纸质时,此处填入准考证模板的路径,当类型为短信时,此处填入短信标识,当类型为模板时,输入模板ID'); $form->listbox('face_ticket_field', '模板字段')->options(RecruitTicketField::ticketFieldData('face'))->attribute('hight', '200px')->help('仅纸质准考证需要,非ex开头的字段将自动渲染'); $form->switch('face_epidemic', '两码上传')->help("下列依赖两码设置,须此项打开才可生效")->default(0)->setMustMark(); $form->switch('face_health', '健康状态')->help('当两码上传打开且该选项打开时,打印准考证必须通过两码审核')->default(0)->setMustMark(); $form->datetimeRange('face_health_start', 'face_health_end', '两码时间')->help("设置该时间后,仅在该时间段内上传该时段内的两码截图才可以"); })->tab('复试', function ($form) { $form->radio('reexamine_ticket_type', '准考证类型')->options([-1 => '不需要',1 => '纸质', 2 => '短信', 3 => '模板'])->default(-1); $form->text('reexamine_ticket_content', '准考证内容')->help('当类型为纸质时,此处填入准考证模板的路径,当类型为短信时,此处填入短信标识,当类型为模板时,输入模板ID'); $form->listbox('reexamine_field', '模板字段')->options(RecruitTicketField::ticketFieldData('reexamine'))->attribute('hight', '200px')->help('仅纸质准考证需要,非ex开头的字段将自动渲染'); }); return $form; } /** * Make a form builder. * * @return Form */ public function store(Request $request) { $verify = $this->form()->getValidateInput();//这个方法会调用Form自带的验证和表单处理(文件上传等)验证错误会直接返回错误.不需要判断; $postCode = $request->input('postcode', []); $postName = $request->input('postname', []); if (count($postCode) == 0 or (count($postCode) >= 1 and $postCode[0] == null)) { return admin_toastr('请填写招考岗位', 'error'); } if (count($postName) == 0 or (count($postName) >= 1 and $postName[0] == null)) { return admin_toastr('请填写招考岗位名称', 'error'); } $data = []; $data['name'] = $verify['name']; $data['company'] = $verify['company']; $data['name_en'] = (array_key_exists('name_en',$verify) && !empty($verify['name_en'])) ? $verify['name_en'] : uniqid(); if(array_key_exists('small_img',$verify)){ $data['small_img'] = $verify['small_img']; }else{ $data['small_img'] = theme_asset('app/images/index/recruit_index.jpg'); } $data['status'] = $verify['status']; $data['show_report'] = $verify['show_report']; $data['current'] = $verify['current']; $data['step'] = implode(',',array_filter($verify['step'])); $data['apply_start'] = $verify['apply_start'] ? $verify['apply_start'] : null;//报名时间 $data['apply_end'] = $verify['apply_end'] ? $verify['apply_end'] : null; $data['audit_start'] = $verify['audit_start'] ? $verify['audit_start'] : null;//审核时间 $data['audit_end'] = $verify['audit_end'] ? $verify['audit_end'] : null; $data['preliminary_start'] = $verify['preliminary_start'] ? $verify['preliminary_start'] : null;//笔试时间 $data['preliminary_end'] = $verify['preliminary_end'] ? $verify['preliminary_end'] : null; $data['computer_start'] = $verify['computer_start'] ? $verify['computer_start'] : null;//上机时间 $data['computer_end'] = $verify['computer_end'] ? $verify['computer_end'] : null; $data['interview_start'] = $verify['interview_start'] ? $verify['interview_start'] : null;//面试时间 $data['interview_end'] = $verify['interview_end'] ? $verify['interview_end'] : null; $data['reexamine_start'] = $verify['reexamine_start'] ? $verify['reexamine_start'] : null;//复试时间 $data['reexamine_end'] = $verify['reexamine_end'] ? $verify['reexamine_end'] : null; $data['health_start'] = $verify['health_start'] ? $verify['health_start'] : null;//体检时间 $data['health_end'] = $verify['health_end'] ? $verify['health_end'] : null; $data['political_start'] = $verify['political_start'] ? $verify['political_start'] : null;//政审时间 $data['political_end'] = $verify['political_end'] ? $verify['political_end'] : null; $data['publicity_start'] = $verify['publicity_start'] ? $verify['publicity_start'] : null;//公示时间 $data['publicity_end'] = $verify['publicity_end'] ? $verify['publicity_end'] : null; $data['supplement_start'] = $verify['supplement_start'] ? $verify['supplement_start'] : null; $data['supplement_end'] = $verify['supplement_end'] ? $verify['supplement_end'] : null; $data['introduction'] = $verify['introduction']; $data['host_address'] = $verify['host_address']; $data['contact'] = $verify['contact']; $data['phone'] = $verify['phone']; $data['ordid'] = $verify['ordid']; $data['limit_times'] = $verify['limit_times']; $data['post_times'] = $verify['post_times']; $data['pay_switch'] = $verify['pay_switch']; $data['forms'] = implode(',',array_filter($verify['forms'])); $data['pen_ticket_type'] = $verify['pen_ticket_type']; $data['pen_ticket_content'] = $verify['pen_ticket_content']; $data['pen_ticket_status'] = 0; $data['pen_comfirm'] = $verify['pen_comfirm']; $data['pen_comfirm_start'] = $verify['pen_comfirm_start'] ? $verify['pen_comfirm_start'] : null; $data['pen_comfirm_end'] = $verify['pen_comfirm_end'] ? $verify['pen_comfirm_end'] : null; $data['pen_epidemic'] = $verify['pen_epidemic']; $data['pen_health'] = $verify['pen_health']; $data['pen_health_start'] = $verify['pen_health_start'] ? $verify['pen_health_start'] : null; $data['pen_health_end'] = $verify['pen_health_end'] ? $verify['pen_health_end'] : null; $data['computer_ticket_type'] = $verify['computer_ticket_type']; $data['computer_ticket_content'] = $verify['computer_ticket_content']; $data['computer_ticket_status'] = 0; $data['computer_ticket_field'] = implode(',',$verify['computer_ticket_field']); $data['face_ticket_type'] = $verify['face_ticket_type']; $data['face_ticket_content'] = $verify['face_ticket_content']; $data['face_ticket_status'] = 0; $data['face_ticket_field'] = implode(',',$verify['face_ticket_field']); $data['face_epidemic'] = $verify['face_epidemic']; $data['face_health'] = $verify['face_health']; $data['face_health_start'] = $verify['face_health_start'] ? $verify['face_health_start'] : null; $data['face_health_end'] = $verify['face_health_end'] ? $verify['face_health_end'] : null; $data['reexamine_ticket_type'] = $verify['reexamine_ticket_type']; $data['reexamine_ticket_content'] = $verify['reexamine_ticket_content']; $data['reexamine_ticket_status'] = 0; $data['reexamine_field'] = implode(',',$verify['reexamine_field']); $fileCharater = $request->input('addFile'); DB::beginTransaction();//检查数据库事务 try { $recruit = Recruit::create($data); $recruit_id = $recruit->id; //添加招聘岗位 $postcode_array = $request->postcode; $postname_array = $request->postname; $postnumber_array = $request->postnumber; $limit_array = $request->postlimit; $countnum = count($postcode_array); for ($i = 0; $i < $countnum; $i++) { $data = array(); if ($postcode_array[$i] !== '' and $postname_array[$i] !== '') { $data['code'] = $postcode_array[$i]; $data['name'] = $postname_array[$i]; $data['number'] = $postnumber_array[$i]; $data['limit'] = $limit_array[$i]; $data['status'] = 1; $data['recruit_id'] = $recruit_id; RecruitPost::create($data); } } if (!empty($fileCharater)) { foreach ($fileCharater as $f => $fv) { $picpath = 'recruit/' . date('Ymd', time()) . '/'; //获取文件的扩展名 $ext = $fv->getClientOriginalExtension(); //获取文件的绝对路径 $path = $fv->getRealPath(); //定义文件名 $filename = time() . rand(100, 999) . '.' . $ext; //存储文件。disk里面的public。总的来说,就是调用disk模块里的public配置 Storage::disk('public')->put($picpath . $filename, file_get_contents($path)); $data = $picpath . $filename; $create_arr = [ 'recruit_id' => $recruit_id, 'subjoin_name' => $fv->getClientOriginalName(), 'subjoin_path' => $data, 'subjoin_addtime' => time() ]; RecruitSubjoin::create($create_arr); } } DB::commit();//检查数据库事务 } catch (\Exception $e) { DB::rollback(); return admin_toastr($e->getMessage(), 'error'); } } /** * 更新报名场次信息 * @param $id * @param Request $request */ public function update($id, Request $request) { $verify = $this->Form()->getValidateInput();//这个方法会调用Form自带的验证和表单处理(文件上传等)验证错误会直接返回错误.不需要判断; $postCode = $request->input('postcode', []); $postName = $request->input('postname', []); if (count($postCode) == 0 or (count($postCode) >= 1 and $postCode[0] == null)) { return admin_toastr('请填写招考岗位', 'error'); } if (count($postName) == 0 or (count($postName) >= 1 and $postName[0] == null)) { return admin_toastr('请填写招考岗位名称', 'error'); } $recruit_id = $id; $data = []; $data['name'] = $verify['name']; $data['company'] = $verify['company']; $data['name_en'] = (array_key_exists('name_en',$verify) && !empty($verify['name_en'])) ? $verify['name_en'] : uniqid(); if(array_key_exists('small_img',$verify)){ $data['small_img'] = $verify['small_img']; }else{ $data['small_img'] = theme_asset('app/images/index/recruit_index.jpg'); } $data['status'] = $verify['status']; $data['show_report'] = $verify['show_report']; $data['current'] = $verify['current']; $data['step'] = implode(',',array_filter($verify['step'])); $data['apply_start'] = $verify['apply_start'] ? $verify['apply_start'] : null;//报名时间 $data['apply_end'] = $verify['apply_end'] ? $verify['apply_end'] : null; $data['audit_start'] = $verify['audit_start'] ? $verify['audit_start'] : null;//审核时间 $data['audit_end'] = $verify['audit_end'] ? $verify['audit_end'] : null; $data['preliminary_start'] = $verify['preliminary_start'] ? $verify['preliminary_start'] : null;//笔试时间 $data['preliminary_end'] = $verify['preliminary_end'] ? $verify['preliminary_end'] : null; $data['computer_start'] = $verify['computer_start'] ? $verify['computer_start'] : null;//上机时间 $data['computer_end'] = $verify['computer_end'] ? $verify['computer_end'] : null; $data['interview_start'] = $verify['interview_start'] ? $verify['interview_start'] : null;//面试时间 $data['interview_end'] = $verify['interview_end'] ? $verify['interview_end'] : null; $data['reexamine_start'] = $verify['reexamine_start'] ? $verify['reexamine_start'] : null;//复试时间 $data['reexamine_end'] = $verify['reexamine_end'] ? $verify['reexamine_end'] : null; $data['health_start'] = $verify['health_start'] ? $verify['health_start'] : null;//体检时间 $data['health_end'] = $verify['health_end'] ? $verify['health_end'] : null; $data['political_start'] = $verify['political_start'] ? $verify['political_start'] : null;//政审时间 $data['political_end'] = $verify['political_end'] ? $verify['political_end'] : null; $data['publicity_start'] = $verify['publicity_start'] ? $verify['publicity_start'] : null;//公示时间 $data['publicity_end'] = $verify['publicity_end'] ? $verify['publicity_end'] : null; $data['supplement_start'] = $verify['supplement_start'] ? $verify['supplement_start'] : null; $data['supplement_end'] = $verify['supplement_end'] ? $verify['supplement_end'] : null; $data['introduction'] = $verify['introduction']; $data['host_address'] = $verify['host_address']; $data['contact'] = $verify['contact']; $data['phone'] = $verify['phone']; $data['ordid'] = $verify['ordid']; $data['limit_times'] = $verify['limit_times']; $data['post_times'] = $verify['post_times']; $data['pay_switch'] = $verify['pay_switch']; $data['forms'] = implode(',',array_filter($verify['forms'])); $data['pen_ticket_type'] = $verify['pen_ticket_type']; $data['pen_ticket_content'] = $verify['pen_ticket_content']; $data['pen_ticket_status'] = 0; $data['pen_ticket_field'] = implode(',',$verify['pen_ticket_field']); $data['pen_comfirm'] = $verify['pen_comfirm']; $data['pen_comfirm_start'] = $verify['pen_comfirm_start'] ? $verify['pen_comfirm_start'] : null; $data['pen_comfirm_end'] = $verify['pen_comfirm_end'] ? $verify['pen_comfirm_end'] : null; $data['pen_epidemic'] = $verify['pen_epidemic']; $data['pen_health'] = $verify['pen_health']; $data['pen_health_start'] = $verify['pen_health_start'] ? $verify['pen_health_start'] : null; $data['pen_health_end'] = $verify['pen_health_end'] ? $verify['pen_health_end'] : null; $data['computer_ticket_type'] = $verify['computer_ticket_type']; $data['computer_ticket_content'] = $verify['computer_ticket_content']; $data['computer_ticket_status'] = 0; $data['computer_ticket_field'] = implode(',',$verify['computer_ticket_field']); $data['face_ticket_type'] = $verify['face_ticket_type']; $data['face_ticket_content'] = $verify['face_ticket_content']; $data['face_ticket_status'] = 0; $data['face_ticket_field'] = implode(',',$verify['face_ticket_field']); $data['face_epidemic'] = $verify['face_epidemic']; $data['face_health'] = $verify['face_health']; $data['face_health_start'] = $verify['face_health_start'] ? $verify['face_health_start'] : null; $data['face_health_end'] = $verify['face_health_end'] ? $verify['face_health_end'] : null; $data['reexamine_ticket_type'] = $verify['reexamine_ticket_type']; $data['reexamine_ticket_content'] = $verify['reexamine_ticket_content']; $data['reexamine_ticket_status'] = 0; $data['reexamine_field'] = implode(',',$verify['reexamine_field']); $ids = RecruitPost::where('recruit_id', $recruit_id)->pluck('id'); $fileCharater = $request->input('addFile'); DB::beginTransaction();//检查数据库事务 try { $res = Recruit::where('id', $recruit_id)->update($data); $postcode_array = $request->postcode; $postname_array = $request->postname; $postnumber_array = $request->postnumber; $limit_array = $request->postlimit; $postid_arr = $request->postid_arr; $countnum = count($postcode_array); if ($countnum > 0) { $ids = RecruitPost::where('recruit_id', $recruit_id)->pluck('id'); if (count($postid_arr) == 0) {//没有提交岗位代表删除岗位 RecruitPost::where('recruit_id', $recruit_id)->delete(); } else { foreach ($ids as $key => $value) { if (!in_array($value, $postid_arr)) { $post_is_create = RecruitAppointInfo::where('post_id', $value)->first(); if (empty($post_is_create)) { //有报名信息的岗位不能删除 RecruitPost::destroy($value); } } } } for ($i = 0; $i < $countnum; $i++) { $data = array(); if ($postcode_array[$i] !== '' and $postname_array[$i] !== '') { if (isset($postid_arr[$i])) { $post_id = $postid_arr[$i]; $data['code'] = $postcode_array[$i]; $data['name'] = $postname_array[$i]; $data['number'] = $postnumber_array[$i]; $data['limit'] = $limit_array[$i]; $data['recruit_id'] = $recruit_id; RecruitPost::where('id', $post_id)->update($data); } else { $data['code'] = $postcode_array[$i]; $data['name'] = $postname_array[$i]; $data['number'] = $postnumber_array[$i]; $data['limit'] = $limit_array[$i]; $data['recruit_id'] = $recruit_id; RecruitPost::create($data); } } } } else { RecruitPost::where('recruit_id', $recruit_id)->delete(); } $fileCharater = $request->file('addFile'); if (!empty($fileCharater)) { RecruitSubjoin::where('recruit_id', $recruit_id)->delete(); foreach ($fileCharater as $f => $fv) { $picpath = 'zhaokaopic/' . date('Ymd', time()) . '/'; //获取文件的扩展名 $ext = $fv->getClientOriginalExtension(); //获取文件的绝对路径 $path = $fv->getRealPath(); //定义文件名 $filename = time() . rand(100, 999) . '.' . $ext; //存储文件。disk里面的public。总的来说,就是调用disk模块里的public配置 Storage::disk('public')->put($picpath . $filename, file_get_contents($path)); $data = $picpath . $filename; $create_arr = [ 'recruit_id' => $recruit_id, 'subjoin_name' => $fv->getClientOriginalName(), 'subjoin_path' => $data, 'subjoin_addtime' => time() ]; RecruitSubjoin::create($create_arr); } } DB::commit(); return admin_toastr('操作成功!', 'success'); } catch (\Exception $e) { DB::rollback(); return admin_toastr($e->getMessage(), 'error'); } } /** * 删掉指定招考场次 * @param $id */ public function destroy($id) { Permission::check('recruit_manager_del'); $info = Recruit::find($id); if($info){ if($info->delete()){ //RecruitAppointInfo::where('recruit_id', $id)->delete(); //todo保留 return response()->json(['status' => 1, 'message' => '删除成功!'], '200'); }else{ return response()->json(['status' => 0, 'message' => '删除失败!'], '200'); } }else{ return response()->json(['status' => 0, 'message' => '找不到记录!'], '200'); } //Recruit::find($id)->delete(); } /** * 报名管理 * @param Content $content * @param Request $request * @return Content|\Illuminate\Http\RedirectResponse */ public function appointList(Content $content, Request $request) { Permission::check('recruit_appoint_list'); $id = $request->id; $recruit = Recruit::find($id); if (empty($recruit)) { return back(); } $search_data = $request->all(); $where = []; $where[] = ['audit','>',0]; if (isset($search_data['id']) || session('manage_search_data')['id']) { if (isset($search_data['page'])) { if (session('search_data')) { $where = session('managewhere'); unset($search_data['page']); $search_data = session('manage_search_data'); } } foreach ($search_data as $k => $v) { if ($k == 'realname') { $where[] = [$k, 'like', "%$v%"]; } elseif ($k == 'id') { $where[] = ['recruit_appoint_info.recruit_id', '=', $v]; } elseif($k == 'print_bs'){ $where[] = ['recruit_ticket.ex_type', '=', 1]; $where[] = ['recruit_ticket.ex_status', '=', $v]; } elseif($k == 'print_js'){ $where[] = ['recruit_ticket.ex_type', '=', 2]; $where[] = ['recruit_ticket.ex_status', '=', $v]; } elseif($k == 'print_ms'){ $where[] = ['recruit_ticket.ex_type', '=', 3]; $where[] = ['recruit_ticket.ex_status', '=', $v]; } elseif ($k != '_pjax' and $k != 'page' && $k != 'perpage') { $where[] = [$k, '=', $v]; } } session(['managewhere' => $where]); session(['manage_search_data' => $search_data]); session()->save(); } $session_data = session('search_data'); if(isset($session_data['perpage'])){ $perpage = $session_data['perpage']; }else{ $perpage = 20; } $list = RecruitAppointInfo::where($where) ->join('recruit_post', 'recruit_appoint_info.post_id', '=', 'recruit_post.id', 'left') ->join('recruit_ticket', 'recruit_ticket.appoint_id', '=', 'recruit_appoint_info.id','left') ->select('recruit_appoint_info.*', 'recruit_post.code', 'recruit_post.name') ->orderBy('recruit_appoint_info.updated_at','desc') ->paginate($perpage); foreach ($list as $k => $v){ if($v->sex == 0){ $list[$k]['sex'] = '女'; }else{ $list[$k]['sex'] = '男'; } switch ($v->political_affiliation){ case '01': $list[$k]['political_affiliation'] = '中共党员'; break; case '02': $list[$k]['political_affiliation'] = '中共预备党员'; break; case '03': $list[$k]['political_affiliation'] = '共青团员'; break; case '04': $list[$k]['political_affiliation'] = '民革党员'; break; case '05': $list[$k]['political_affiliation'] = '民盟盟员'; break; case '06': $list[$k]['political_affiliation'] = '民建会员'; break; case '07': $list[$k]['political_affiliation'] = '民进会员'; break; case '08': $list[$k]['political_affiliation'] = '农工党党员'; break; case '09': $list[$k]['political_affiliation'] = '致公党党员'; break; case '10': $list[$k]['political_affiliation'] = '九三学社社员'; break; case '11': $list[$k]['political_affiliation'] = '台盟盟员'; break; case '12': $list[$k]['political_affiliation'] = '无党派人士'; break; case '13': $list[$k]['political_affiliation'] = '群众'; break; } $list[$k]['pen_print'] = 0; $list[$k]['computer_print'] = 0; $list[$k]['face_print'] = 0; $list[$k]['reexamine_print'] = 0; $tickets = RecruitTicket::where('appoint_id',$v->id)->get(); if($tickets){ foreach ($tickets as $tk => $tv){ if($tv->ex_type == 1){ $list[$k]['pen_print'] = $tv->ex_status; } if($tv->ex_type == 2){ $list[$k]['computer_print'] = $tv->ex_status; } if($tv->ex_type == 3){ $list[$k]['face_print'] = $tv->ex_status; } if($tv->ex_type == 4){ $list[$k]['reexamine_print'] = $tv->ex_status; } } } } $post_data = RecruitPost::where('recruit_id',$id)->where('status',1)->selectRaw('id, CONCAT(code," ",name) as post')->pluck('post', 'id'); return $content ->header('报名管理') ->description('招考人员信息列表') ->body(view('admin.recruit.appoint_list')->with([ 'list' => $list, 'search_data' => $search_data, 'recruit' => $recruit, 'post' => $post_data ])); } /** * 查看报名详细信息 * @param Request $request * @return \Illuminate\Http\JsonResponse * @throws \Throwable */ public function getUserinfo(Request $request) { Permission::check('recruit_getUserinfo'); $id = $request->id; $data = RecruitAppointInfo::where('recruit_appoint_info.id',$id) ->join('recruit_post', 'recruit_appoint_info.post_id', '=', 'recruit_post.id', 'left') ->join('recruit_appoint_expand_special', 'recruit_appoint_info.id', '=', 'recruit_appoint_expand_special.recruit_appoint_id', 'left') ->join('recruit_appoint_detail', 'recruit_appoint_detail.recruit_appoint_id', '=', 'recruit_appoint_info.id', 'left') ->select('recruit_appoint_info.*', 'recruit_post.name', 'recruit_post.code', 'recruit_appoint_detail.train', 'recruit_appoint_detail.rewards_and_punishments', 'recruit_appoint_detail.introduce', 'recruit_appoint_expand_special.point_apply', 'recruit_appoint_expand_special.condition', 'recruit_appoint_expand_special.material') ->first(); $recruit = Recruit::where('id',$data->recruit_id)->first(); $recruit->forms = explode(',', $recruit->forms); $data->family = json_decode($data->family); if ($data->family) { foreach ($data->family as $k => $v) { $v->political_affiliation = RecruitAppointInfo::$political_affiliation[$v->political_affiliation]; } } //layer相册层 $photos = [ 'material'=>[], 'identification'=>[], 'education_certification'=>[], 'other_certification'=>[], ]; if(in_array('expand_special',$recruit->forms)){ if(json_decode($data->material)){ $data->material = json_decode($data->material); $photo_data = []; foreach ($data->material as $k => $v) { if($v->status){ $photo_data[] = [ 'alt' => $v->name, 'pid' => $v->uid, 'src' => $v->response->path, ]; } } $photos['material'] = [ 'title' => '申请加分佐证材料', 'id' => 1, 'start' => 0, 'data' =>$photo_data ]; }else{ $data->material = []; } } if(in_array('identification',$recruit->forms) || in_array('internship',$recruit->forms)){ if(json_decode($data->identification)){ $data->identification = json_decode($data->identification); $photo_data = []; foreach ($data->identification as $k => $v) { if($v->status){ $photo_data[] = [ 'alt' => $v->name, 'pid' => $v->uid, 'src' => $v->response->path, ]; } } $photos['identification'] = [ 'title' => '身份证明', 'id' => 1, 'start' => 0, 'data' =>$photo_data ]; }else{ $data->identification = []; } } if(in_array('education_certification',$recruit->forms) || in_array('internship',$recruit->forms)){ if(json_decode($data->education_certification)){ $data->education_certification = json_decode($data->education_certification); $photo_data = []; foreach ($data->education_certification as $k => $v) { if($v->status){ $photo_data[] = [ 'alt' => $v->name, 'pid' => $v->uid, 'src' => $v->response->path, ]; } } $photos['education_certification'] = [ 'title' => '学历证明', 'id' => 1, 'start' => 0, 'data' =>$photo_data ]; }else{ $data->education_certification = []; } } if(in_array('other_certification',$recruit->forms) || in_array('internship',$recruit->forms)){ if(json_decode($data->other_certification)){ $data->other_certification = json_decode($data->other_certification); $photo_data = []; foreach ($data->other_certification as $k => $v) { if($v->status){ $photo_data[] = [ 'alt' => $v->name, 'pid' => $v->uid, 'src' => $v->response->path, ]; } } $photos['other_certification'] = [ 'title' => '其他证明', 'id' => 1, 'start' => 0, 'data' =>$photo_data ]; }else{ $data->other_certification = []; } } $html = view('admin.recruit.manageajax_userinfo')->with(['appointinfo' => $data,'recruit' => $recruit,'photos'=>$photos])->render(); return response()->json(['code' => 1, 'data' => $html]); } /** * 第一阶段(报名审核) * @param Request $request * @return \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\Response|mixed|\Psr\Container\ContainerInterface|\Symfony\Component\HttpFoundation\Response|\think\Response * @throws \Throwable */ public function ajax_audit(Request $request) { Permission::check('recruit_ajax_audit'); $ids = $request->ids; $view_data['ids'] = $ids; return response(['data' => view('admin.recruit.ajax_audit')->with($view_data)->render(), 'status' => 1], '200'); } /** * 材料补登审核 * @param Request $request * @return \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\Response|mixed|\Psr\Container\ContainerInterface|\Symfony\Component\HttpFoundation\Response|\think\Response * @throws \Throwable */ public function ajax_supplement(Request $request) { Permission::check('recruit_ajax_supplement'); $ids = $request->ids; $view_data['ids'] = $ids; $info = RecruitSupplement::where('appoint_id',$ids)->where('type','supplement')->first(); if(!$info){ $view_data['switch'] = 0; $view_data['photos'] = [ 'identification'=>[], 'household_register' => [], 'education_certification'=>[], 'family_planning'=>[], 'manage' => [] ]; }else{ $view_data['switch'] = 1; $photos = [ 'identification'=>[], 'household_register' => [], 'education_certification'=>[], 'family_planning'=>[], 'manage' => [] ]; $info->identification = json_decode($info->identification); $photo_data = []; if(is_array($info->identification)){ foreach ($info->identification as $k => $v) { if($v->status){ $photo_data[] = [ 'alt' => $v->name, 'pid' => $v->uid, 'src' => $v->response->path, ]; } } } $photos['identification'] = [ 'title' => '身份证明', 'id' => 1, 'start' => 0, 'data' =>$photo_data ]; $info->household_register = json_decode($info->household_register); $photo_data = []; if(is_array($info->household_register)){ foreach ($info->household_register as $k => $v) { if($v->status){ $photo_data[] = [ 'alt' => $v->name, 'pid' => $v->uid, 'src' => $v->response->path, ]; } } } $photos['household_register'] = [ 'title' => '户口簿', 'id' => 1, 'start' => 0, 'data' =>$photo_data ]; $info->education_certification = json_decode($info->education_certification); $photo_data = []; if(is_array($info->education_certification)){ foreach ($info->education_certification as $k => $v) { if($v->status){ $photo_data[] = [ 'alt' => $v->name, 'pid' => $v->uid, 'src' => $v->response->path, ]; } } } $photos['education_certification'] = [ 'title' => '教育证明', 'id' => 1, 'start' => 0, 'data' =>$photo_data ]; // $info->family_planning = json_decode($info->family_planning); // $photo_data = []; // foreach ($info->family_planning as $k => $v) { // if($v->status){ // $photo_data[] = [ // 'alt' => $v->name, // 'pid' => $v->uid, // 'src' => $v->response->path, // ]; // } // } // $photos['family_planning'] = [ // 'title' => '计生证明', // 'id' => 1, // 'start' => 0, // 'data' =>$photo_data // ]; $info->manage = json_decode($info->manage); $photo_data = []; if(is_array($info->manage)){ foreach ($info->manage as $k => $v) { if($v->status){ $photo_data[] = [ 'alt' => $v->name, 'pid' => $v->uid, 'src' => $v->response->path, ]; } } } $photos['manage'] = [ 'title' => '综治证明', 'id' => 1, 'start' => 0, 'data' =>$photo_data ]; $view_data['info'] = $info; $view_data['photos'] = $photos; } return response(['data' => view('admin.recruit.ajax_supplement')->with($view_data)->render(), 'status' => 1], '200'); } /** * 健康信息审核 * @param Request $request * @return \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\Response|mixed|\Psr\Container\ContainerInterface|\Symfony\Component\HttpFoundation\Response|\think\Response * @throws \Throwable */ public function ajax_health(Request $request) { Permission::check('recruit_ajax_health'); $ids = $request->ids; $type = $request->type; $view_data['ids'] = $ids; $info = RecruitSupplement::where('appoint_id',$ids)->where("type",$type)->first(); $view_data['type'] = $type; if(!$info){ $view_data['switch'] = 0; $view_data['photos'] = []; }else{ $view_data['switch'] = 1; $photos = [ 'health_code'=>[], 'trip_code' => [] ]; $info->health_code = json_decode($info->health_code); $photo_data = []; if(is_array($info->health_code)){ foreach ($info->health_code as $k => $v) { if($v->status){ $photo_data[] = [ 'alt' => $v->name, 'pid' => $v->uid, 'src' => $v->response->path, ]; } } } $photos['health_code'] = [ 'title' => '健康码', 'id' => 1, 'start' => 0, 'data' =>$photo_data ]; $info->trip_code = json_decode($info->trip_code); $photo_data = []; if(is_array($info->trip_code)){ foreach ($info->trip_code as $k => $v) { if($v->status){ $photo_data[] = [ 'alt' => $v->name, 'pid' => $v->uid, 'src' => $v->response->path, ]; } } } $photos['trip_code'] = [ 'title' => '行程码', 'id' => 1, 'start' => 0, 'data' =>$photo_data ]; $view_data['info'] = $info; $view_data['photos'] = $photos; } return response(['data' => view('admin.recruit.ajax_health')->with($view_data)->render(), 'status' => 1], '200'); } /** * 报名记录审核处理 * @param Request $request * @return \Illuminate\Http\JsonResponse */ public function appoint_audit(Request $request) { $ids = $request->ids; if (!is_array($ids)) { $ids = explode(",", $ids); } if (empty($ids)) { return response()->json(['status' => 0, 'msg' => '请选择审核记录!'], '200'); } $audit = $request->audit; $exam_flow_path = $request->exam_flow_path; $reason = $request->reason; if(empty($audit)){ return response()->json(['status' => 0, 'msg' => '请选择审核状态!'], '200'); } if($audit == '3' && empty($exam_flow_path)){ return response()->json(['status' => 0, 'msg' => '请选择审核后的考试流程!'], '200'); } if($audit != '3' && empty($reason)){ return response()->json(['status' => 0, 'msg' => '请输入审核原因!'], '200'); } $message = []; switch ($audit){ case '1': //撤回至未审核 foreach ($ids as $k => $v){ $appointinfo = RecruitAppointInfo::where('id', $v)->first(); if(!$appointinfo || intval($appointinfo->audit) === 1){ continue; } //设置该报名的各个状态 $appointinfo_data = [ 'current' => 1, 'audit' => 1, 'pen_audit' => -1, 'computer_audit' => -1, 'face_audit' => -1, 'reexamine_audit' => -1, 'inspect_audit' => -1, 'political_audit' => -1, 'employ_audit' => -1 ]; RecruitAppointInfo::where('id', $v)->update($appointinfo_data); //写日志 $log = [ 'type' => 2, 'step' => 1, 'appoint_id' => $v, 'uid' => Admin::user()->id, 'log' => '撤回至未审核状态,原因是:'.$reason ]; RecruitAppointLog::create($log); $message[$v] = '您此次的报名需要重新审核,原因是:'.$reason; } break; case '2': //审核未通过 foreach ($ids as $k => $v){ $appointinfo = RecruitAppointInfo::where('id', $v)->first(); if(!$appointinfo || intval($appointinfo->audit) === 2){ continue; } //设置该报名的各个状态 $appointinfo_data = [ 'current' => 1, 'audit' => 2, 'pen_audit' => -1, 'computer_audit' => -1, 'face_audit' => -1, 'reexamine_audit' => -1, 'inspect_audit' => -1, 'political_audit' => -1, 'employ_audit' => -1 ]; RecruitAppointInfo::where('id', $v)->update($appointinfo_data); //写日志 $log = [ 'type' => 2, 'step' => 1, 'appoint_id' => $v, 'uid' => Admin::user()->id, 'log' => '审核未通过,原因是:'.$reason ]; RecruitAppointLog::create($log); $message[$v] = '您此次报名审核未通过,原因是:'.$reason; $this->smsService->sendSms($appointinfo->mobile,'sms_recruit_register_error',array('reason'=>$reason)); } break; case '3': //审核通过 foreach ($ids as $k => $v){ $appointinfo = RecruitAppointInfo::where('id', $v)->first(); if(!$appointinfo || intval($appointinfo->audit) === 3){ continue; } $recruit = Recruit::where('id',$appointinfo->recruit_id)->first(); $step = explode(',',$recruit->step); $step_str = [ 'pen' => '未设置此条报名记录的笔试信息', ]; if(in_array('3',$step)){ //场次有设置笔试 if(in_array('pen',$exam_flow_path)){ $step_str['pen'] = '该场次需要笔试,已设置此条报考需要参与笔试'; $pen_audit = -1; }else{ $step_str['pen'] = '该场次需要笔试,此条报考可跳过笔试'; $pen_audit = 3; } }else{ $step_str['pen'] = '该场次不需要笔试'; $pen_audit = 3; } if(in_array('4',$step)){ //场次有设置上机 if(in_array('computer',$exam_flow_path)){ $step_str['computer'] = '该场次需要上机,已设置此条报考需要参与上机'; $computer_audit = -1; }else{ $step_str['computer'] = '该场次需要上机,此条报考可跳过上机'; $computer_audit = 3; } }else{ $step_str['computer'] = '该场次不需要上机'; $computer_audit = 3; } if(in_array('5',$step)){ //场次有设置上机 if(in_array('face',$exam_flow_path)){ $step_str['face'] = '该场次需要面试,已设置此条报考需要参与面试'; $face_audit = -1; }else{ $step_str['face'] = '该场次需要面试,此条报考可跳过面试'; $face_audit = 3; } }else{ $step_str['face'] = '该场次不需要面试'; $face_audit = 3; } if(in_array('6',$step)){ //场次有设置复试 if(in_array('reexamine',$exam_flow_path)){ $step_str['reexamine'] = '该场次需要复试,已设置此条报考需要参与复试'; $reexamine_audit = -1; }else{ $step_str['reexamine'] = '该场次需要复试,此条报考可跳过复试'; $reexamine_audit = 3; } }else{ $step_str['reexamine'] = '该场次不需要复试'; $reexamine_audit = 3; } //设置该报名的各个状态 $appointinfo_data = [ 'current' => 2,//审核成功后进入考试流程 'audit' => 3, 'pen_audit' => $pen_audit, 'computer_audit' => $computer_audit, 'face_audit' => $face_audit, 'reexamine_audit' => $reexamine_audit, 'inspect_audit' => -1, 'political_audit' => -1, 'employ_audit' => -1 ]; RecruitAppointInfo::where('id', $v)->update($appointinfo_data); $reason = $reason ?? '符合报考条件'; //写日志 $log = [ 'type' => 2, 'step' => 1, 'appoint_id' => $v, 'uid' => Admin::user()->id, 'log' => '审核通过,原因是:' . $reason, 'admin_log' => implode(';',$step_str) ]; RecruitAppointLog::create($log); $message[$v] = '您此次报名审核已通过,原因是:' . $reason; $this->smsService->sendSms($appointinfo->mobile,'sms_recruit_register_success',array('reason'=>$reason)); $this->fetch_word(['recruit_id'=>$appointinfo->recruit_id,'appoint_id'=>$appointinfo->id]); } break; } //站内信 foreach ($ids as $key => $val) { if(array_key_exists($val,$message)){ $user_info = Member::where('id', $appointinfo->uid)->first(); Pms::write_pmsnotice($user_info->id, $user_info->username, $message[$val]); }else{ continue; } } return response()->json(['status' => 1, 'msg' => '操作成功!', 'data' => 'ok']); } /** * 材料补登审核处理 * @param Request $request * @return \Illuminate\Http\JsonResponse */ public function supplement(Request $request) { Permission::check('ajax_supplement'); $ids = $request->ids; if (empty($ids)) { return response()->json(['status' => 0, 'msg' => '请选择审核记录!'], '200'); } $status = $request->status; $reason = $request->reason; if(empty($status)){ return response()->json(['status' => 0, 'msg' => '请选择审核状态!'], '200'); } if($status == -1 && empty($reason)){ return response()->json(['status' => 0, 'msg' => '请输入审核原因!'], '200'); } if($status == -1){ $info = RecruitSupplement::where('appoint_id', $ids)->where('type','supplement')->first(); $appointinfo = RecruitAppointInfo::where('id', $ids)->first(); //写日志 $log = [ 'type' => 2, 'step' => 1, 'appoint_id' => $ids, 'uid' => Admin::user()->id, 'log' => '材料补登审核未通过,原因是:'.$reason ]; RecruitAppointLog::create($log); $info->status = -1; $info->msg = $reason; $info->save(); $appointinfo->political_audit = 0; $appointinfo->save(); $this->smsService->sendSms($appointinfo->mobile,'sms_recruit_register_error',array('reason'=>$reason)); } if($status == 1){ $reason = $reason ?? '符合报考条件'; $info = RecruitSupplement::where('appoint_id', $ids)->where('type','supplement')->first(); $appointinfo = RecruitAppointInfo::where('id', $ids)->first(); //写日志 $log = [ 'type' => 2, 'step' => 1, 'appoint_id' => $ids, 'uid' => Admin::user()->id, 'log' => '审核通过,原因是:' . $reason ]; RecruitAppointLog::create($log); $info->status = 1; $info->msg = $reason; $info->save(); $appointinfo->political_audit = 1; $appointinfo->save(); $this->smsService->sendSms($appointinfo->mobile,'sms_recruit_register_success',array('reason'=>$reason)); } return response()->json(['status' => 1, 'msg' => '操作成功!', 'data' => 'ok']); } /** * 健康信息处理 * @param Request $request * @return \Illuminate\Http\JsonResponse */ public function health(Request $request) { Permission::check('ajax_health'); $ids = $request->ids; if (empty($ids)) { return response()->json(['status' => 0, 'msg' => '请选择审核记录!'], '200'); } $type = $request->type; $status = $request->h_status; $reason = $request->reason; if(empty($status)){ return response()->json(['status' => 0, 'msg' => '请选择审核状态!'], '200'); } if($status == -1 && empty($reason)){ return response()->json(['status' => 0, 'msg' => '请输入审核原因!'], '200'); } if($status == -1){ $info = RecruitSupplement::where('appoint_id', $ids)->where('type',$type)->first(); $appointinfo = RecruitAppointInfo::where('id', $ids)->first(); //写日志 $log = [ 'type' => 2, 'step' => 1, 'appoint_id' => $ids, 'uid' => Admin::user()->id, 'log' => '健康信息审核未通过,原因是:'.$reason ]; RecruitAppointLog::create($log); $info->h_status = -1; $info->h_msg = $reason; $info->save(); $appointinfo->health_audit = 0; $appointinfo->save(); $this->smsService->sendSms($appointinfo->mobile,'sms_recruit_register_error',array('reason'=>$reason)); } if($status == 1){ $reason = $reason ?? '健康信息审核通过,请及时打印准考证'; $info = RecruitSupplement::where('appoint_id', $ids)->where('type',$type)->first(); $appointinfo = RecruitAppointInfo::where('id', $ids)->first(); //写日志 $log = [ 'type' => 2, 'step' => 1, 'appoint_id' => $ids, 'uid' => Admin::user()->id, 'log' => '审核通过,原因是:' . $reason ]; RecruitAppointLog::create($log); $info->h_status = 1; $info->h_msg = $reason; $info->save(); $appointinfo->health_audit = 1; $appointinfo->save(); $this->smsService->sendSms($appointinfo->mobile,'sms_recruit_register_success',array('reason'=>$reason)); } return response()->json(['status' => 1, 'msg' => '操作成功!', 'data' => 'ok']); } public function fetchWord(Request $request) { $recruit_id = $request->recruit_id; $appoint_id = $request->appoint_id; if(!empty($recruit_id) && !empty($appoint_id)){ $url = $this->fetch_word(['recruit_id'=>$recruit_id,'appoint_id'=>$appoint_id]); return response()->json(['status' => 1, 'msg' => '生成Word简历成功!', 'data' => 'ok', 'url' => $url]); }else{ return response()->json(['status' => 0, 'msg' => '参数缺失!', 'data' => 'fail']); } } /** * 查看审核日志 * @param Request $request * @return \Illuminate\Http\JsonResponse */ public function showLog(Request $request) { Permission::check('recruit_show_log'); $id = $request->id; $logs = RecruitAppointLog::where('appoint_id', $id)->orderBy('created_at', 'desc')->get()->toArray(); $str = ""; if ($logs) { $str .= "
审核时间 | 操作级别 | 记录类型 | 触发操作的人员 | 审核描述 |
" . $v['created_at'] . " | " . $level . " | " . $step . " | " . $user . " | " . $v['log'] . " |