|
@@ -511,6 +511,9 @@ class IndexController extends WebBaseController
|
|
|
if(in_array('expand_special',$forms)){
|
|
|
$special = RecruitAppointExpandSpecial::where('recruit_appoint_id',$user_info['id'])->first();
|
|
|
if($special){
|
|
|
+ if(strpos(',',$special['condition']) !== false){
|
|
|
+ $special['condition'] = explode(',',$special['condition']);
|
|
|
+ }
|
|
|
$material = json_decode($special['material'],true);
|
|
|
if(is_array($material)){
|
|
|
foreach ($material as $k => $v){
|
|
@@ -521,7 +524,6 @@ class IndexController extends WebBaseController
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}else{
|
|
|
$material = [];
|
|
|
$special = [
|
|
@@ -1019,34 +1021,33 @@ class IndexController extends WebBaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $data['family'] = json_encode($family);
|
|
|
- if($appoint_info){
|
|
|
- //如果已有报名记录,进入修改阶段的处理流程
|
|
|
- DB::beginTransaction();
|
|
|
- try{
|
|
|
- RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$recruit_id)->update($data);
|
|
|
- //分模块解析数据
|
|
|
-
|
|
|
- //如果有加分模块
|
|
|
- if(in_array('expand_special',$forms)){
|
|
|
- $special = $request->input('special');
|
|
|
- if($special['point_apply']){
|
|
|
- if(!array_key_exists('material',$special)){
|
|
|
- return response()->json(['status' => 0,'msg' => '加分佐证材料不能为空!']);
|
|
|
- }
|
|
|
- //删除掉没有成功返回路径的图片
|
|
|
- if(is_array($special['material'])){
|
|
|
- foreach ($special['material'] as $k => $v){
|
|
|
- if(!array_key_exists('response',$v)){
|
|
|
- unset($special['material'][$k]);
|
|
|
- }
|
|
|
+ $data['family'] = json_encode($family);
|
|
|
+ if($appoint_info){
|
|
|
+ //如果已有报名记录,进入修改阶段的处理流程
|
|
|
+ DB::beginTransaction();
|
|
|
+ try{
|
|
|
+ RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$recruit_id)->update($data);
|
|
|
+ //分模块解析数据
|
|
|
+ //如果有加分模块
|
|
|
+ if(in_array('expand_special',$forms)){
|
|
|
+ $special = $request->input('special');
|
|
|
+ if($special['point_apply']){//如果申请加分
|
|
|
+ if(!array_key_exists('material',$special)){
|
|
|
+ return response()->json(['status' => 0,'msg' => '加分佐证材料不能为空!']);
|
|
|
+ }
|
|
|
+ //删除掉没有成功返回路径的图片
|
|
|
+ if(is_array($special['material'])){
|
|
|
+ foreach ($special['material'] as $k => $v){
|
|
|
+ if(!array_key_exists('response',$v)){
|
|
|
+ unset($special['material'][$k]);
|
|
|
}
|
|
|
}
|
|
|
- $special['material'] = json_encode($special['material']);
|
|
|
- }else{
|
|
|
- $special['condition'] = '';
|
|
|
- $special['material'] = json_encode([]);
|
|
|
}
|
|
|
+ $special['point'] = 0;
|
|
|
+ if(is_array($special['condition'])){
|
|
|
+ $special['condition'] = implode(',',$special['condition']);
|
|
|
+ }
|
|
|
+ $special['material'] = json_encode($special['material']);
|
|
|
$hasRecord = RecruitAppointExpandSpecial::where('recruit_appoint_id',$appoint_info->id)->first();
|
|
|
if($hasRecord){
|
|
|
RecruitAppointExpandSpecial::where('recruit_appoint_id',$appoint_info->id)->update($special);
|
|
@@ -1055,295 +1056,296 @@ class IndexController extends WebBaseController
|
|
|
RecruitAppointExpandSpecial::create($special);
|
|
|
}
|
|
|
}
|
|
|
- //如果有详情模块
|
|
|
- if(in_array('detail',$forms) || in_array('internship',$forms)){
|
|
|
- $detail = $request->input('detail');
|
|
|
- $hasRecord = RecruitAppointDetail::where('recruit_appoint_id',$appoint_info->id)->first();
|
|
|
- if($hasRecord){
|
|
|
- RecruitAppointDetail::where('recruit_appoint_id',$appoint_info->id)->update($detail);
|
|
|
- }else{
|
|
|
- $detail['recruit_appoint_id'] = $appoint_info->id;
|
|
|
- RecruitAppointDetail::create($detail);
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+ //如果有详情模块
|
|
|
+ if(in_array('detail',$forms) || in_array('internship',$forms)){
|
|
|
+ $detail = $request->input('detail');
|
|
|
+ $hasRecord = RecruitAppointDetail::where('recruit_appoint_id',$appoint_info->id)->first();
|
|
|
+ if($hasRecord){
|
|
|
+ RecruitAppointDetail::where('recruit_appoint_id',$appoint_info->id)->update($detail);
|
|
|
+ }else{
|
|
|
+ $detail['recruit_appoint_id'] = $appoint_info->id;
|
|
|
+ RecruitAppointDetail::create($detail);
|
|
|
}
|
|
|
- //如果有身份证明模块
|
|
|
- if(in_array('identification',$forms) || in_array('internship',$forms)){
|
|
|
- $identification = $request->input('identification');
|
|
|
- if(is_array($identification)){
|
|
|
- //删除掉没有成功返回路径的图片
|
|
|
- foreach ($identification as $k => $v){
|
|
|
- if(!array_key_exists('response',$v)){
|
|
|
- unset($identification[$k]);
|
|
|
- }
|
|
|
+
|
|
|
+ }
|
|
|
+ //如果有身份证明模块
|
|
|
+ if(in_array('identification',$forms) || in_array('internship',$forms)){
|
|
|
+ $identification = $request->input('identification');
|
|
|
+ if(is_array($identification)){
|
|
|
+ //删除掉没有成功返回路径的图片
|
|
|
+ foreach ($identification as $k => $v){
|
|
|
+ if(!array_key_exists('response',$v)){
|
|
|
+ unset($identification[$k]);
|
|
|
}
|
|
|
}
|
|
|
- $appoint_info->identification = json_encode($identification);
|
|
|
- $appoint_info->save();
|
|
|
}
|
|
|
- //如果有教育证明模块
|
|
|
- if(in_array('education_certification',$forms) || in_array('internship',$forms)){
|
|
|
- $education_certification = $request->input('education_certification');
|
|
|
- if(is_array($education_certification)){
|
|
|
- //删除掉没有成功返回路径的图片
|
|
|
- foreach ($education_certification as $k => $v){
|
|
|
- if(!array_key_exists('response',$v)){
|
|
|
- unset($education_certification[$k]);
|
|
|
- }
|
|
|
+ $appoint_info->identification = json_encode($identification);
|
|
|
+ $appoint_info->save();
|
|
|
+ }
|
|
|
+ //如果有教育证明模块
|
|
|
+ if(in_array('education_certification',$forms) || in_array('internship',$forms)){
|
|
|
+ $education_certification = $request->input('education_certification');
|
|
|
+ if(is_array($education_certification)){
|
|
|
+ //删除掉没有成功返回路径的图片
|
|
|
+ foreach ($education_certification as $k => $v){
|
|
|
+ if(!array_key_exists('response',$v)){
|
|
|
+ unset($education_certification[$k]);
|
|
|
}
|
|
|
}
|
|
|
- $appoint_info->education_certification = json_encode($education_certification);
|
|
|
- $appoint_info->save();
|
|
|
}
|
|
|
- //如果有其他证明模块
|
|
|
- if(in_array('other_certification',$forms) || in_array('internship',$forms)){
|
|
|
- $other_certification = $request->input('other_certification');
|
|
|
- if(is_array($other_certification)){
|
|
|
- //删除掉没有成功返回路径的图片
|
|
|
- foreach ($other_certification as $k => $v){
|
|
|
- if(!array_key_exists('response',$v)){
|
|
|
- unset($other_certification[$k]);
|
|
|
- }
|
|
|
+ $appoint_info->education_certification = json_encode($education_certification);
|
|
|
+ $appoint_info->save();
|
|
|
+ }
|
|
|
+ //如果有其他证明模块
|
|
|
+ if(in_array('other_certification',$forms) || in_array('internship',$forms)){
|
|
|
+ $other_certification = $request->input('other_certification');
|
|
|
+ if(is_array($other_certification)){
|
|
|
+ //删除掉没有成功返回路径的图片
|
|
|
+ foreach ($other_certification as $k => $v){
|
|
|
+ if(!array_key_exists('response',$v)){
|
|
|
+ unset($other_certification[$k]);
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- if($other_certification){
|
|
|
- $appoint_info->other_certification = json_encode($other_certification);
|
|
|
- $appoint_info->save();
|
|
|
- }
|
|
|
+ if($other_certification){
|
|
|
+ $appoint_info->other_certification = json_encode($other_certification);
|
|
|
+ $appoint_info->save();
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- //如果有承诺书模块
|
|
|
- if(in_array('chengnuoshu',$forms)){
|
|
|
- $chengnuoshu = $request->input('chengnuoshu');
|
|
|
- if(is_array($chengnuoshu)){
|
|
|
- //删除掉没有成功返回路径的图片
|
|
|
- foreach ($chengnuoshu as $k => $v){
|
|
|
- if(!array_key_exists('response',$v)){
|
|
|
- unset($chengnuoshu[$k]);
|
|
|
- }
|
|
|
+ //如果有承诺书模块
|
|
|
+ if(in_array('chengnuoshu',$forms)){
|
|
|
+ $chengnuoshu = $request->input('chengnuoshu');
|
|
|
+ if(is_array($chengnuoshu)){
|
|
|
+ //删除掉没有成功返回路径的图片
|
|
|
+ foreach ($chengnuoshu as $k => $v){
|
|
|
+ if(!array_key_exists('response',$v)){
|
|
|
+ unset($chengnuoshu[$k]);
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- if($chengnuoshu){
|
|
|
- $appoint_info->chengnuoshu = json_encode($chengnuoshu);
|
|
|
- $appoint_info->save();
|
|
|
- }
|
|
|
+ if($chengnuoshu){
|
|
|
+ $appoint_info->chengnuoshu = json_encode($chengnuoshu);
|
|
|
+ $appoint_info->save();
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- //如果有失信被执行人模块
|
|
|
- if(in_array('shixin',$forms)){
|
|
|
- $shixin = $request->input('shixin');
|
|
|
- if(is_array($shixin)){
|
|
|
- //删除掉没有成功返回路径的图片
|
|
|
- foreach ($shixin as $k => $v){
|
|
|
- if(!array_key_exists('response',$v)){
|
|
|
- unset($shixin[$k]);
|
|
|
- }
|
|
|
+ //如果有失信被执行人模块
|
|
|
+ if(in_array('shixin',$forms)){
|
|
|
+ $shixin = $request->input('shixin');
|
|
|
+ if(is_array($shixin)){
|
|
|
+ //删除掉没有成功返回路径的图片
|
|
|
+ foreach ($shixin as $k => $v){
|
|
|
+ if(!array_key_exists('response',$v)){
|
|
|
+ unset($shixin[$k]);
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ if($shixin){
|
|
|
+ $appoint_info->shixin = json_encode($shixin);
|
|
|
+ $appoint_info->save();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- if($shixin){
|
|
|
- $appoint_info->shixin = json_encode($shixin);
|
|
|
- $appoint_info->save();
|
|
|
+ //如果有声明书模块
|
|
|
+ if(in_array('baokaoshengming',$forms)){
|
|
|
+ $baokaoshengming = $request->input('baokaoshengming');
|
|
|
+ if(is_array($baokaoshengming)){
|
|
|
+ //删除掉没有成功返回路径的图片
|
|
|
+ foreach ($baokaoshengming as $k => $v){
|
|
|
+ if(!array_key_exists('response',$v)){
|
|
|
+ unset($baokaoshengming[$k]);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //如果有声明书模块
|
|
|
- if(in_array('baokaoshengming',$forms)){
|
|
|
- $baokaoshengming = $request->input('baokaoshengming');
|
|
|
- if(is_array($baokaoshengming)){
|
|
|
+ if($baokaoshengming){
|
|
|
+ $appoint_info->baokaoshengming = json_encode($baokaoshengming);
|
|
|
+ $appoint_info->save();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ DB::commit();
|
|
|
+ if($operation == 2){
|
|
|
+ $log = [
|
|
|
+ 'type' => 3,
|
|
|
+ 'appoint_id'=> $appoint_info->id,
|
|
|
+ 'uid' => $uid,
|
|
|
+ 'log' => '用户提交报名'
|
|
|
+ ];
|
|
|
+ RecruitAppointLog::create($log);
|
|
|
+ return ['status' => 1, 'msg' => '提交成功', 'data' => $appoint_info->id];
|
|
|
+ }else{
|
|
|
+ return ['status' => 1, 'msg' => '资料保存成功,请尽快完善并提交', 'data' => $appoint_info->id];
|
|
|
+ }
|
|
|
+ } catch (\Exception $e){
|
|
|
+ DB::rollback();
|
|
|
+ return ['status' => 0, 'msg' => $e->getMessage()];
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //没有报名记录,进入增加阶段的处理流程
|
|
|
+ DB::beginTransaction();
|
|
|
+ try{
|
|
|
+ //20220726增加地区undefined选项处理
|
|
|
+ if($index = stripos($data['native_place'],',undefined')){
|
|
|
+ $data['native_place'] = substr($data['native_place'],0,$index);
|
|
|
+ }
|
|
|
+ if($index = stripos($data['house_register'],',undefined')){
|
|
|
+ $data['house_register'] = substr($data['house_register'],0,$index);
|
|
|
+ }
|
|
|
+
|
|
|
+ $data['uid'] = $uid;
|
|
|
+ $data['recruit_id'] = $recruit_id;
|
|
|
+ $result = RecruitAppointInfo::create($data);
|
|
|
+ //分模块解析数据
|
|
|
+ $forms = explode(',', $recruit['forms']);
|
|
|
+ //如果有加分模块
|
|
|
+ if(in_array('expand_special',$forms)){
|
|
|
+ $special = $request->input('special');
|
|
|
+ if($special['point_apply']){
|
|
|
+ if(is_array($special['material'])){
|
|
|
//删除掉没有成功返回路径的图片
|
|
|
- foreach ($baokaoshengming as $k => $v){
|
|
|
+ foreach ($special['material'] as $k => $v){
|
|
|
if(!array_key_exists('response',$v)){
|
|
|
- unset($baokaoshengming[$k]);
|
|
|
+ unset($special['material'][$k]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if($baokaoshengming){
|
|
|
- $appoint_info->baokaoshengming = json_encode($baokaoshengming);
|
|
|
- $appoint_info->save();
|
|
|
- }
|
|
|
+ $special['material'] = json_encode($special['material']);
|
|
|
}
|
|
|
- DB::commit();
|
|
|
- if($operation == 2){
|
|
|
- $log = [
|
|
|
- 'type' => 3,
|
|
|
- 'appoint_id'=> $appoint_info->id,
|
|
|
- 'uid' => $uid,
|
|
|
- 'log' => '用户提交报名'
|
|
|
- ];
|
|
|
- RecruitAppointLog::create($log);
|
|
|
- return ['status' => 1, 'msg' => '提交成功', 'data' => $appoint_info->id];
|
|
|
- }else{
|
|
|
- return ['status' => 1, 'msg' => '资料保存成功,请尽快完善并提交', 'data' => $appoint_info->id];
|
|
|
- }
|
|
|
- } catch (\Exception $e){
|
|
|
- DB::rollback();
|
|
|
- return ['status' => 0, 'msg' => $e->getMessage()];
|
|
|
+ $special['recruit_appoint_id'] = $result->id;
|
|
|
+ RecruitAppointExpandSpecial::create($special);
|
|
|
}
|
|
|
- }else{
|
|
|
- //没有报名记录,进入增加阶段的处理流程
|
|
|
- DB::beginTransaction();
|
|
|
- try{
|
|
|
- //20220726增加地区undefined选项处理
|
|
|
- if($index = stripos($data['native_place'],',undefined')){
|
|
|
- $data['native_place'] = substr($data['native_place'],0,$index);
|
|
|
- }
|
|
|
- if($index = stripos($data['house_register'],',undefined')){
|
|
|
- $data['house_register'] = substr($data['house_register'],0,$index);
|
|
|
- }
|
|
|
-
|
|
|
- $data['uid'] = $uid;
|
|
|
- $data['recruit_id'] = $recruit_id;
|
|
|
- $result = RecruitAppointInfo::create($data);
|
|
|
- //分模块解析数据
|
|
|
- $forms = explode(',', $recruit['forms']);
|
|
|
- //如果有加分模块
|
|
|
- if(in_array('expand_special',$forms)){
|
|
|
- $special = $request->input('special');
|
|
|
- if($special['point_apply']){
|
|
|
- if(is_array($special['material'])){
|
|
|
- //删除掉没有成功返回路径的图片
|
|
|
- foreach ($special['material'] as $k => $v){
|
|
|
- if(!array_key_exists('response',$v)){
|
|
|
- unset($special['material'][$k]);
|
|
|
- }
|
|
|
- }
|
|
|
+ //如果有详情模块
|
|
|
+ if(in_array('detail',$forms) || in_array('internship',$forms)){
|
|
|
+ $detail = $request->input('detail');
|
|
|
+ $detail['recruit_appoint_id'] = $result->id;
|
|
|
+ RecruitAppointDetail::create($detail);
|
|
|
+ }
|
|
|
+ //如果有身份证明模块
|
|
|
+ if(in_array('identification',$forms) || in_array('internship',$forms)){
|
|
|
+ $identification = $request->input('identification');
|
|
|
+ if(is_array($identification)){
|
|
|
+ //删除掉没有成功返回路径的图片
|
|
|
+ foreach ($identification as $k => $v){
|
|
|
+ if(!array_key_exists('response',$v)){
|
|
|
+ unset($identification[$k]);
|
|
|
}
|
|
|
- $special['material'] = json_encode($special['material']);
|
|
|
}
|
|
|
- $special['recruit_appoint_id'] = $result->id;
|
|
|
- RecruitAppointExpandSpecial::create($special);
|
|
|
}
|
|
|
- //如果有详情模块
|
|
|
- if(in_array('detail',$forms) || in_array('internship',$forms)){
|
|
|
- $detail = $request->input('detail');
|
|
|
- $detail['recruit_appoint_id'] = $result->id;
|
|
|
- RecruitAppointDetail::create($detail);
|
|
|
+
|
|
|
+ $result->identification = json_encode($identification);
|
|
|
+ $result->save();
|
|
|
+ }
|
|
|
+ //如果有教育证明模块
|
|
|
+ if(in_array('education_certification',$forms) || in_array('internship',$forms)){
|
|
|
+ $education_certification = $request->input('education_certification');
|
|
|
+ if(is_array($education_certification)){
|
|
|
+ //删除掉没有成功返回路径的图片
|
|
|
+ foreach ($education_certification as $k => $v){
|
|
|
+ if(!array_key_exists('response',$v)){
|
|
|
+ unset($education_certification[$k]);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- //如果有身份证明模块
|
|
|
- if(in_array('identification',$forms) || in_array('internship',$forms)){
|
|
|
- $identification = $request->input('identification');
|
|
|
- if(is_array($identification)){
|
|
|
+
|
|
|
+ $result->education_certification = json_encode($education_certification);
|
|
|
+ $result->save();
|
|
|
+ }
|
|
|
+ //如果有其他证明模块
|
|
|
+ if(in_array('other_certification',$forms) || in_array('internship',$forms)){
|
|
|
+ $other_certification = $request->input('other_certification');
|
|
|
+
|
|
|
+ if($other_certification){
|
|
|
+ if(is_array($other_certification)){
|
|
|
//删除掉没有成功返回路径的图片
|
|
|
- foreach ($identification as $k => $v){
|
|
|
+ foreach ($other_certification as $k => $v){
|
|
|
if(!array_key_exists('response',$v)){
|
|
|
- unset($identification[$k]);
|
|
|
+ unset($other_certification[$k]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $result->identification = json_encode($identification);
|
|
|
+ $result->other_certification = json_encode($other_certification);
|
|
|
$result->save();
|
|
|
}
|
|
|
- //如果有教育证明模块
|
|
|
- if(in_array('education_certification',$forms) || in_array('internship',$forms)){
|
|
|
- $education_certification = $request->input('education_certification');
|
|
|
- if(is_array($education_certification)){
|
|
|
+ }
|
|
|
+
|
|
|
+ //如果有承诺书模块
|
|
|
+ if(in_array('chengnuoshu',$forms)){
|
|
|
+ $chengnuoshu = $request->input('chengnuoshu');
|
|
|
+ if($chengnuoshu){
|
|
|
+ if(is_array($chengnuoshu)){
|
|
|
//删除掉没有成功返回路径的图片
|
|
|
- foreach ($education_certification as $k => $v){
|
|
|
+ foreach ($chengnuoshu as $k => $v){
|
|
|
if(!array_key_exists('response',$v)){
|
|
|
- unset($education_certification[$k]);
|
|
|
+ unset($chengnuoshu[$k]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $result->education_certification = json_encode($education_certification);
|
|
|
+ $result->chengnuoshu = json_encode($chengnuoshu);
|
|
|
$result->save();
|
|
|
}
|
|
|
- //如果有其他证明模块
|
|
|
- if(in_array('other_certification',$forms) || in_array('internship',$forms)){
|
|
|
- $other_certification = $request->input('other_certification');
|
|
|
+ }
|
|
|
|
|
|
- if($other_certification){
|
|
|
- if(is_array($other_certification)){
|
|
|
- //删除掉没有成功返回路径的图片
|
|
|
- foreach ($other_certification as $k => $v){
|
|
|
- if(!array_key_exists('response',$v)){
|
|
|
- unset($other_certification[$k]);
|
|
|
- }
|
|
|
+ //如果有失信被执行人模块
|
|
|
+ if(in_array('shixin',$forms)){
|
|
|
+ $shixin = $request->input('shixin');
|
|
|
+ if($shixin){
|
|
|
+ if(is_array($shixin)){
|
|
|
+ //删除掉没有成功返回路径的图片
|
|
|
+ foreach ($shixin as $k => $v){
|
|
|
+ if(!array_key_exists('response',$v)){
|
|
|
+ unset($shixin[$k]);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- $result->other_certification = json_encode($other_certification);
|
|
|
- $result->save();
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- //如果有承诺书模块
|
|
|
- if(in_array('chengnuoshu',$forms)){
|
|
|
- $chengnuoshu = $request->input('chengnuoshu');
|
|
|
- if($chengnuoshu){
|
|
|
- if(is_array($chengnuoshu)){
|
|
|
- //删除掉没有成功返回路径的图片
|
|
|
- foreach ($chengnuoshu as $k => $v){
|
|
|
- if(!array_key_exists('response',$v)){
|
|
|
- unset($chengnuoshu[$k]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- $result->chengnuoshu = json_encode($chengnuoshu);
|
|
|
- $result->save();
|
|
|
- }
|
|
|
+ $result->shixin = json_encode($shixin);
|
|
|
+ $result->save();
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- //如果有失信被执行人模块
|
|
|
- if(in_array('shixin',$forms)){
|
|
|
- $shixin = $request->input('shixin');
|
|
|
- if($shixin){
|
|
|
- if(is_array($shixin)){
|
|
|
- //删除掉没有成功返回路径的图片
|
|
|
- foreach ($shixin as $k => $v){
|
|
|
- if(!array_key_exists('response',$v)){
|
|
|
- unset($shixin[$k]);
|
|
|
- }
|
|
|
+ //如果有声明书模块
|
|
|
+ if(in_array('baokaoshengming',$forms)){
|
|
|
+ $baokaoshengming = $request->input('baokaoshengming');
|
|
|
+ if($baokaoshengming){
|
|
|
+ if(is_array($baokaoshengming)){
|
|
|
+ //删除掉没有成功返回路径的图片
|
|
|
+ foreach ($baokaoshengming as $k => $v){
|
|
|
+ if(!array_key_exists('response',$v)){
|
|
|
+ unset($baokaoshengming[$k]);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- $result->shixin = json_encode($shixin);
|
|
|
- $result->save();
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- //如果有声明书模块
|
|
|
- if(in_array('baokaoshengming',$forms)){
|
|
|
- $baokaoshengming = $request->input('baokaoshengming');
|
|
|
- if($baokaoshengming){
|
|
|
- if(is_array($baokaoshengming)){
|
|
|
- //删除掉没有成功返回路径的图片
|
|
|
- foreach ($baokaoshengming as $k => $v){
|
|
|
- if(!array_key_exists('response',$v)){
|
|
|
- unset($baokaoshengming[$k]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- $result->baokaoshengming = json_encode($baokaoshengming);
|
|
|
- $result->save();
|
|
|
- }
|
|
|
- }
|
|
|
- DB::commit();
|
|
|
- if($operation == 2){
|
|
|
- $log = [
|
|
|
- 'type' => 3,
|
|
|
- 'appoint_id'=> $result->id,
|
|
|
- 'uid' => $uid,
|
|
|
- 'log' => '用户首次提交报名'
|
|
|
- ];
|
|
|
- RecruitAppointLog::create($log);
|
|
|
- return ['status' => 1, 'msg' => '提交成功', 'data' => $result->id];
|
|
|
- }else{
|
|
|
- return ['status' => 1, 'msg' => '资料保存成功,请尽快完善并提交', 'data' => $result->id];
|
|
|
+ $result->baokaoshengming = json_encode($baokaoshengming);
|
|
|
+ $result->save();
|
|
|
}
|
|
|
-
|
|
|
- } catch (\Exception $e){
|
|
|
- DB::rollback();
|
|
|
- return ['status' => 0, 'msg' => $e->getMessage()];
|
|
|
}
|
|
|
+ DB::commit();
|
|
|
+ if($operation == 2){
|
|
|
+ $log = [
|
|
|
+ 'type' => 3,
|
|
|
+ 'appoint_id'=> $result->id,
|
|
|
+ 'uid' => $uid,
|
|
|
+ 'log' => '用户首次提交报名'
|
|
|
+ ];
|
|
|
+ RecruitAppointLog::create($log);
|
|
|
+ return ['status' => 1, 'msg' => '提交成功', 'data' => $result->id];
|
|
|
+ }else{
|
|
|
+ return ['status' => 1, 'msg' => '资料保存成功,请尽快完善并提交', 'data' => $result->id];
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (\Exception $e){
|
|
|
+ DB::rollback();
|
|
|
+ return ['status' => 0, 'msg' => $e->getMessage()];
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|