|
@@ -83,6 +83,26 @@ class IndexController extends WebBaseController
|
|
|
}
|
|
|
}
|
|
|
if($appoint_info){
|
|
|
+ //20221115增加确认笔试功能
|
|
|
+ if($recruit->pen_comfirm){
|
|
|
+ if($appoint_info->audit != 3){//审核未通过,无需确认
|
|
|
+ $appoint_info->pen_comfirm = 0;
|
|
|
+ }else{
|
|
|
+ $time = time();
|
|
|
+ if(strtotime($recruit->pen_comfirm_start) > $time || strtotime($recruit->pen_comfirm_end) < $time){
|
|
|
+ $appoint_info->pen_comfirm = -1; //确认未开始
|
|
|
+ }else{
|
|
|
+ if($appoint_info->pen_audit != -2){
|
|
|
+ $appoint_info->pen_comfirm = -2;//已确认无需再次确认
|
|
|
+ }else{
|
|
|
+ $appoint_info->pen_comfirm = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $appoint_info->pen_comfirm = 0;//无需确认
|
|
|
+ }
|
|
|
+
|
|
|
//笔试
|
|
|
$pen_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',1)->first();
|
|
|
if($pen_ticket){
|
|
@@ -142,6 +162,7 @@ class IndexController extends WebBaseController
|
|
|
}
|
|
|
}else{
|
|
|
$appoint_info = new \stdClass();
|
|
|
+ $appoint_info->pen_comfirm = 0;
|
|
|
$appoint_info->pen_audit = 0;
|
|
|
$appoint_info->post_id = 0;
|
|
|
$appoint_info->pen_ticket = 0;
|
|
@@ -2500,4 +2521,56 @@ class IndexController extends WebBaseController
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public function comfirm_pen(Request $request){
|
|
|
+ $user = $this->getUser();
|
|
|
+ if (!empty($user)) {
|
|
|
+ $uid = $user->id;
|
|
|
+ } else {
|
|
|
+ return redirect(route('login'));
|
|
|
+ }
|
|
|
+
|
|
|
+ //招考id
|
|
|
+ $id = $request->input('recruit_id', 0);
|
|
|
+ if (!$id) {
|
|
|
+ return ['status' => 0, 'msg' => '请选择报名项目!', 'data' => ''];
|
|
|
+ }
|
|
|
+
|
|
|
+ $recruit = Recruit::find($id);
|
|
|
+ if(!$recruit['status']){
|
|
|
+ return ['status' => 0, 'msg' => '抱歉,该项目状态不正确,请联系客服!', 'data' => ''];
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!$recruit->pen_comfirm){
|
|
|
+ return ['status' => 0, 'msg' => '该项目无须确认笔试考试!', 'data' => ''];
|
|
|
+ }
|
|
|
+
|
|
|
+ $appoint_info = RecruitAppointInfo::where('recruit_id',$id)->where('uid',$uid)->first();
|
|
|
+ if(!$appoint_info){
|
|
|
+ return ['status' => 0, 'msg' => '找不到您的报名记录,请检查!', 'data' => ''];
|
|
|
+ }
|
|
|
+
|
|
|
+ if($appoint_info->audit != 3){
|
|
|
+ return ['status' => 0, 'msg' => '您的报名未审核通过,无需确认!', 'data' => ''];
|
|
|
+ }
|
|
|
+
|
|
|
+ $time = time();
|
|
|
+ if(strtotime($recruit->pen_comfirm_start) > $time || strtotime($recruit->pen_comfirm_end) < $time){
|
|
|
+ return ['status' => 0, 'msg' => '未在笔试确认时间段!', 'data' => ''];
|
|
|
+ }
|
|
|
+
|
|
|
+ if($appoint_info->pen_audit != -2){
|
|
|
+ return ['status' => 0, 'msg' => '您已确认参加笔试,无需再次确认!', 'data' => ''];
|
|
|
+ }
|
|
|
+
|
|
|
+ $appoint_info->update(['pen_audit' => -1]);
|
|
|
+ $log = [
|
|
|
+ 'type' => 3,
|
|
|
+ 'appoint_id'=> $appoint_info->id,
|
|
|
+ 'uid' => $uid,
|
|
|
+ 'log' => '用户确认参加笔试'
|
|
|
+ ];
|
|
|
+ RecruitAppointLog::create($log);
|
|
|
+ return ['status' => 1, 'msg' => '确认成功', 'data' => $appoint_info->id];
|
|
|
+
|
|
|
+ }
|
|
|
}
|