|
@@ -374,30 +374,19 @@ class IndexController extends WebBaseController
|
|
|
if ($recruit['current'] != 1 && $recruit['current'] != 2) {
|
|
|
return $this->showMessage('抱歉,该项目报名通道已关闭,如有疑问,请联系客服!', route('recruit.show', ['id', $recruit['id']]), true, '上一页', '3');
|
|
|
}
|
|
|
- $appoint_info = RecruitAppointInfo::where('uid', $uid)->where('recruit_id', $id)->first();
|
|
|
+ if($recruit['limit_times'] == 1){
|
|
|
+ $appoint_info = RecruitAppointInfo::where('uid', $uid)->where('recruit_id', $id)->first();
|
|
|
+ }else{
|
|
|
+ $appoint_info_id = $request->input('appoint_info_id', 0);
|
|
|
+ $appoint_info = null;
|
|
|
+ if($appoint_info_id > 0){
|
|
|
+ $appoint_info = RecruitAppointInfo::where('id', $appoint_info_id)->first();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
$time = time();
|
|
|
$formDisabled = 0;
|
|
|
- if (($time < strtotime($recruit['apply_start']) || strtotime($recruit['apply_end']) < $time)) {//过了招考时间
|
|
|
- if (!in_array($uid, [161027, 59041])) {
|
|
|
- if (!$appoint_info) {
|
|
|
- return $this->showMessage('抱歉,该项目已过报名时间或尚未开始!', route('recruit.show', ['id', $recruit['id']]), true, '上一页', '3');
|
|
|
- }
|
|
|
- if ($appoint_info) {
|
|
|
- //如果有报名记录,先查询首次报名是什么时候
|
|
|
- $first_post = RecruitAppointLog::where('type', 3)->where('uid', $uid)->where('appoint_id', $appoint_info->id)->orderBy('created_at', 'asc')->first();
|
|
|
- if (!$first_post) {//没有记录代表只是暂存
|
|
|
- return $this->showMessage('抱歉,该项目已过报名时间或尚未开始!', route('recruit.show', ['id', $recruit['id']]), true, '上一页', '3');
|
|
|
- }
|
|
|
-// $has_late_post = RecruitAppointLog::where('type',3)->where('uid',$uid)->where('created_at','>',$recruit['apply_end'])->first();//查找在过了报名时间后,有报名记录,且仍是审核失败的报名记录,看其是否在报名时间后是否有再次提交的记录
|
|
|
-// if($has_late_post){
|
|
|
-// $formDisabled = 1;
|
|
|
-// }else{
|
|
|
-// $formDisabled = 0;
|
|
|
-// }
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
|
|
|
$view_data['module'] = $forms = explode(',', $recruit['forms']);
|
|
|
//查询报名表是否已有记录
|
|
@@ -700,12 +689,13 @@ class IndexController extends WebBaseController
|
|
|
// $number = RecruitAppointLog::where('appoint_id',$user_info->id)->where('step',1)->where('type',3)->count();
|
|
|
// $post_number = $number+1;//todo
|
|
|
}
|
|
|
-
|
|
|
+ $appoint_info_id = $appoint_info->id;
|
|
|
|
|
|
} else {
|
|
|
//实习专场
|
|
|
if (in_array('internship', $forms)) {
|
|
|
$user_info = json_encode([
|
|
|
+ 'id' => 0,
|
|
|
'recruit_id' => $id,
|
|
|
'operation' => 1,
|
|
|
'realname' => '',
|
|
@@ -798,7 +788,7 @@ class IndexController extends WebBaseController
|
|
|
$user_info['recruit_id'] = $id;
|
|
|
$user_info['operation'] = 1;
|
|
|
}
|
|
|
-
|
|
|
+ $appoint_info_id = 0;
|
|
|
}
|
|
|
|
|
|
//招考岗位
|
|
@@ -829,6 +819,7 @@ class IndexController extends WebBaseController
|
|
|
$view_data['title'] = $recruit->company;
|
|
|
$view_data['special_condition_type'] = $recruit->special_condition_type;
|
|
|
$view_data['special_condition_value'] = json_decode($recruit->special_condition_value, true);
|
|
|
+
|
|
|
return view('app.recruit.sign_up', $view_data);
|
|
|
|
|
|
}
|
|
@@ -881,22 +872,51 @@ class IndexController extends WebBaseController
|
|
|
return response()->json(['status' => 0, 'msg' => '您的证件已有其他账号的报名记录,请检查!']);
|
|
|
}
|
|
|
|
|
|
- $time = time();
|
|
|
- $appoint_info = RecruitAppointInfo::where('uid', $uid)->where('recruit_id', $recruit_id)->first();
|
|
|
- if (($time < strtotime($recruit['apply_start']) || strtotime($recruit['apply_end']) < $time)) {//过了招考时间
|
|
|
- if (!$appoint_info) {
|
|
|
- return response()->json(['status' => 0, 'msg' => '抱歉,该项目已过报名时间!']);
|
|
|
+ if($recruit['limit_times'] == 1){
|
|
|
+ $time = time();
|
|
|
+ $appoint_info = RecruitAppointInfo::where('uid', $uid)->where('recruit_id', $recruit_id)->first();
|
|
|
+ if (($time < strtotime($recruit['apply_start']) || strtotime($recruit['apply_end']) < $time)) {//过了招考时间
|
|
|
+ if (!$appoint_info) {
|
|
|
+ return response()->json(['status' => 0, 'msg' => '抱歉,该项目已过报名时间!']);
|
|
|
+ }
|
|
|
+ if (($time < strtotime($recruit['audit_start']) || strtotime($recruit['audit_end']) < $time)) {//过了审核时间
|
|
|
+ return response()->json(['status' => 0, 'msg' => '抱歉,该项目已过审核时间,无法继续报名!']);
|
|
|
+ }
|
|
|
+ //如果有报名记录,先查询首次报名是什么时候
|
|
|
+ $first_post = RecruitAppointLog::where('type', 3)->where('uid', $uid)->orderBy('created_at', 'asc')->first();
|
|
|
+ if (!$first_post) {//没有记录代表只是暂存
|
|
|
+ return response()->json(['status' => 0, 'msg' => '抱歉,该项目已过报名时间!']);
|
|
|
+ }
|
|
|
}
|
|
|
- if (($time < strtotime($recruit['audit_start']) || strtotime($recruit['audit_end']) < $time)) {//过了审核时间
|
|
|
- return response()->json(['status' => 0, 'msg' => '抱歉,该项目已过审核时间,无法继续报名!']);
|
|
|
+ }else{
|
|
|
+ $time = time();
|
|
|
+ $id = $request->input('id');
|
|
|
+ if($id > 0){
|
|
|
+ $appoint_info = RecruitAppointInfo::where('id', $id)->first();
|
|
|
+ }else{
|
|
|
+ $post_id = $request->input('post_id');
|
|
|
+ $appoint_info_post = RecruitAppointInfo::where('uid', $uid)->where('recruit_id', $recruit_id)->where('post_id',$post_id)->first();
|
|
|
+ if($appoint_info_post){
|
|
|
+ return response()->json(['status' => 0, 'msg' => '相同岗位已存在报名记录,请检查 !']);
|
|
|
+ }
|
|
|
+ $appoint_info_count = RecruitAppointInfo::where('uid', $uid)->where('recruit_id', $recruit_id)->count();
|
|
|
+ if($appoint_info_count >= $recruit['limit_times']){
|
|
|
+ return response()->json(['status' => 0, 'msg' => '超过报名次数上限!']);
|
|
|
+ }
|
|
|
+ $appoint_info = null;
|
|
|
}
|
|
|
- //如果有报名记录,先查询首次报名是什么时候
|
|
|
- $first_post = RecruitAppointLog::where('type', 3)->where('uid', $uid)->orderBy('created_at', 'asc')->first();
|
|
|
- if (!$first_post) {//没有记录代表只是暂存
|
|
|
- return response()->json(['status' => 0, 'msg' => '抱歉,该项目已过报名时间!']);
|
|
|
+ if (($time < strtotime($recruit['apply_start']) || strtotime($recruit['apply_end']) < $time)) {//过了招考时间
|
|
|
+ if($id == 0){
|
|
|
+ return response()->json(['status' => 0, 'msg' => '抱歉,该项目已过报名时间!']);
|
|
|
+ }
|
|
|
+ $first_post = RecruitAppointLog::where('appoint_id',$id)->where('type', 3)->where('uid', $uid)->orderBy('created_at', 'asc')->first();
|
|
|
+ if (!$first_post) {//没有记录代表只是暂存
|
|
|
+ return response()->json(['status' => 0, 'msg' => '抱歉,该项目已过报名时间!']);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
$data = $request->only('realname', 'sex', 'birthday', 'avatar', 'nation', 'native_place', 'political_affiliation', 'titles', 'join_time', 'work', 'house_register', 'education', 'school', 'degree', 'pro', 'address', 'card_type', 'card', 'mobile', 'email', 'concat_name', 'concat_mobile', 'resume', 'post_id', 'adjust', 'remark', 'graduation');
|
|
|
if (!array_key_exists('post_id', $data)) {
|
|
|
return response()->json(['status' => 0, 'msg' => '请选择报考岗位']);
|
|
@@ -1078,7 +1098,7 @@ class IndexController extends WebBaseController
|
|
|
//如果已有报名记录,进入修改阶段的处理流程
|
|
|
DB::beginTransaction();
|
|
|
try {
|
|
|
- RecruitAppointInfo::where('uid', $uid)->where('recruit_id', $recruit_id)->update($data);
|
|
|
+ RecruitAppointInfo::where('id', $appoint_info->id)->update($data);
|
|
|
//分模块解析数据
|
|
|
//如果有加分模块
|
|
|
if (in_array('expand_special', $forms)) {
|
|
@@ -3029,4 +3049,35 @@ class IndexController extends WebBaseController
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ public function show_sign_limit(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' => ''];
|
|
|
+ }
|
|
|
+
|
|
|
+ $list = RecruitAppointInfo::where('uid', $user->id)
|
|
|
+ ->join('recruit', 'recruit.id', '=', 'recruit_appoint_info.recruit_id', 'left')
|
|
|
+ ->join('recruit_post', 'recruit_post.id', '=', 'recruit_appoint_info.post_id', 'left')
|
|
|
+ ->select('recruit.name as recruit_name', 'recruit_appoint_info.*', 'recruit_post.code', 'recruit_post.name')
|
|
|
+ ->where('recruit_appoint_info.recruit_id','=',$id)
|
|
|
+ ->get();
|
|
|
+
|
|
|
+ $html = view('app.recruit.show_sign_limit')->with(['list' => $list , 'total' => count($list)])->render();
|
|
|
+ return response()->json(['code' => 1, 'data' => $html]);
|
|
|
+
|
|
|
+ }
|
|
|
}
|