|
@@ -111,6 +111,15 @@ class IndexController extends WebBaseController
|
|
|
}else{
|
|
|
$appoint_info->face_ticket = 0;
|
|
|
}
|
|
|
+
|
|
|
+ //复试
|
|
|
+ $reexamine_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',4)->first();
|
|
|
+
|
|
|
+ if($reexamine_ticket && $appoint_info->reexamine_audit == -1){
|
|
|
+ $appoint_info->reexamine_ticket = 1;
|
|
|
+ }else{
|
|
|
+ $appoint_info->reexamine_ticket = 0;
|
|
|
+ }
|
|
|
}else{
|
|
|
$appoint_info = new \stdClass();
|
|
|
$appoint_info->pen_audit = 0;
|
|
@@ -1255,4 +1264,51 @@ class IndexController extends WebBaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public function reexamine_ticket(Request $request)
|
|
|
+ {
|
|
|
+ $user = $this->getUser();
|
|
|
+ if (!empty($user)) {
|
|
|
+ $uid = $user->id;
|
|
|
+ } else {
|
|
|
+ return $this->showMessage('请登录!', route('home'), true, '上一页', '3');
|
|
|
+ }
|
|
|
+ $recruit_id = $request->input('recruit_id');
|
|
|
+ $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$recruit_id)->first();
|
|
|
+ if($appoint_info){
|
|
|
+ $reexamine_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',4)->first();
|
|
|
+ if($reexamine_ticket){
|
|
|
+ $time = time();
|
|
|
+ if(strtotime($reexamine_ticket->ex_start) < $time && strtotime($reexamine_ticket->ex_end) > $time){
|
|
|
+ RecruitTicket::where('id',$reexamine_ticket->id)->update(['ex_status' => 1]);
|
|
|
+ $recruit = Recruit::where('id',$recruit_id)->first();
|
|
|
+ $post_data = RecruitPost::where('recruit_id',$recruit_id)->where('status',1)->selectRaw('id, CONCAT(code," ",name) as post')->pluck('post', 'id');
|
|
|
+ $name = $recruit->name_en;
|
|
|
+ $date = date("Y-m-d",strtotime($recruit->created_at));
|
|
|
+ $filename = $date . '_' . $appoint_info->realname . '_' . $appoint_info->card . '_' . $post_data[$appoint_info->post_id].'_create';
|
|
|
+ $file = base_path() . "/storage/app/public/recruit/ticket/pdf/{$date}/{$name}/face/" . $filename . '.pdf';
|
|
|
+ if(file_exists($file)){
|
|
|
+ header('Content-Description: File Transfer');
|
|
|
+ header('Content-Type: application/octet-stream');
|
|
|
+ header('Content-Disposition: attachment; filename='.basename($file));
|
|
|
+ header('Content-Transfer-Encoding: binary');
|
|
|
+ header('Expires: 0');
|
|
|
+ header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
|
|
+ header('Pragma: public');
|
|
|
+ header('Content-Length: ' . filesize($file));
|
|
|
+ ob_clean(); //重要的就是这个函数的调用, 清空但不关闭输出缓存, 否则下载的文件头两个字符会是0a
|
|
|
+ flush();
|
|
|
+ readfile($file);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ return $this->showMessage('非打印时间!', route('home'), true, '上一页', '3');
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|