Browse Source

Merge branch 'master' of http://59.57.98.130:3000/jjhc/jucai

linwu 1 year ago
parent
commit
4b1ba11740

+ 1 - 0
.gitignore

@@ -21,3 +21,4 @@ horizon.log
 database
 online2020m
 /app/Http/Controllers/Web/Talent/JjhcController.php
+/public/ylYevzhTr82M029A4fmEG7E6OhzSbMSEm95YOG4vcavN2Cqbfb9qNsHrB0hbC1Jd.php

+ 19 - 13
app/Admin/Controllers/Recruit/RecruitController.php

@@ -274,8 +274,8 @@ class RecruitController extends Controller
             ])->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 => '整场下拉选择',2 => '岗位适配(单选)',3 => '岗位适配(多选)'])->default(0);
-            $form->text('special_condition_value', '加分条件值')->default("")->help('如选择岗位适合,此放放空,选择整场下拉选择项请用英文,隔开');
+            $form->radio('special_condition_type', '加分条件样式')->options([0 => '手输', 1 => '整场下拉选择',2 => '岗位适配'])->default(0);
+            $form->text('special_condition_value', '加分条件值')->default("")->help('如选择手输或岗位适配,此放放空,选择整场下拉请输入JSON限制值');
         })->tab('笔试', function ($form) {
             $form->switch('pen_comfirm', '笔试确认')->help("打开后将会在设置时间段内开启笔试确认功能,有且仅当确认了才能打印准考证参加笔试")->default(0)->setMustMark();
             $form->datetimeRange('pen_comfirm_start', 'pen_comfirm_end', '确认笔试时间')->help("设置该时间后,仅在该时间段内才可以确认参加笔试");
@@ -794,6 +794,7 @@ class RecruitController extends Controller
 
 
 
+
         $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')
@@ -2560,9 +2561,11 @@ class RecruitController extends Controller
                 if (in_array('identification', explode(',', $recruit->forms)) || in_array('internship',explode(',', $recruit->forms))) {
                     $identification = json_decode($v->identification, true);
                     $identifications = [];
-                    foreach ($identification as $val){
-                        if(array_key_exists('path', $val['response'])){
-                            array_push($identifications,"https://www.jucai.gov.cn" . $val['response']['path']);
+                    if(is_array($identification)){
+                        foreach ($identification as $val){
+                            if(array_key_exists('path', $val['response'])){
+                                array_push($identifications,"https://www.jucai.gov.cn" . $val['response']['path']);
+                            }
                         }
                     }
                     array_push($item, implode("\r\n", $identifications));
@@ -2570,9 +2573,11 @@ class RecruitController extends Controller
                 if (in_array('education_certification', explode(',', $recruit->forms)) || in_array('internship',explode(',', $recruit->forms))) {
                     $education_certification = json_decode($v->education_certification, true);
                     $education_certifications = [];
-                    foreach ($education_certification as $val){
-                        if(array_key_exists('path', $val['response'])){
-                            array_push($education_certifications,"https://www.jucai.gov.cn" . $val['response']['path']);
+                    if(is_array($education_certification)){
+                        foreach ($education_certification as $val){
+                            if(array_key_exists('path', $val['response'])){
+                                array_push($education_certifications,"https://www.jucai.gov.cn" . $val['response']['path']);
+                            }
                         }
                     }
                     array_push($item, implode("\r\n", $education_certifications));
@@ -2580,14 +2585,15 @@ class RecruitController extends Controller
                 if (in_array('other_certification', explode(',', $recruit->forms)) || in_array('internship',explode(',', $recruit->forms))) {
                     $other_certification = json_decode($v->other_certification, true);
                     $other_certifications = [];
-                    if($other_certification){
-                        foreach ($other_certification as $val){
-                            if(array_key_exists('path', $val['response'])){
-                                array_push($other_certifications,"https://www.jucai.gov.cn" . $val['response']['path']);
+                    if(is_array($other_certification)){
+                        if($other_certification){
+                            foreach ($other_certification as $val){
+                                if(array_key_exists('path', $val['response'])){
+                                    array_push($other_certifications,"https://www.jucai.gov.cn" . $val['response']['path']);
+                                }
                             }
                         }
                     }
-
                     array_push($item, implode("\r\n", $other_certifications));
                 }
                 if (in_array('chengnuoshu', explode(',', $recruit->forms))) {

+ 255 - 253
app/Http/Controllers/Web/Recruit/IndexController.php

@@ -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 = [
@@ -776,7 +778,7 @@ class IndexController extends WebBaseController
                 'label' =>  $value['code'] . " " . $value['name']
             ];
             $post_limit[$value['id']] = json_decode($value['limit']);
-            $post_special[$value['id']] = explode(',',$value['special']);
+            $post_special[$value['id']] = json_decode($value['special']);
             array_push($post,$item);
         }
 
@@ -789,7 +791,7 @@ class IndexController extends WebBaseController
         $view_data['formDisable'] = $formDisabled;
         $view_data['title'] = $recruit->company;
         $view_data['special_condition_type'] = $recruit->special_condition_type;
-        $view_data['special_condition_value'] = explode(',',$recruit->special_condition_value);
+        $view_data['special_condition_value'] = json_decode($recruit->special_condition_value,true);
         return view('app.recruit.sign_up',$view_data);
 
     }
@@ -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()];
             }
+        }
 
 
     }

+ 10 - 6
public/themes/default/views/app/recruit/sign_up.blade.php

@@ -785,16 +785,16 @@
                                     </el-form-item>
                                 @elseif($special_condition_type == 1)
                                     <el-form-item prop="special_condition">
-                                        <el-select v-model="user.special.condition" placeholder="请选择您符合的加分条件">
-                                            @foreach($special_condition_value as $v)
-                                                <el-option label="{{ $v }}" value="{{ $v }}"></el-option>
+                                        <el-select v-model="user.special.condition" @if($special_condition_value['multi']) multiple @endif placeholder="请选择您符合的加分条件">
+                                            @foreach($special_condition_value['list'] as $k => $v)
+                                                <el-option label="{{ $v['text'] }}" value="{{ $k }}"></el-option>
                                             @endforeach
                                         </el-select>
                                     </el-form-item>
                                 @else
                                     <el-form-item prop="special_condition">
-                                        <el-select v-model="user.special.condition" placeholder="请选择您符合的加分条件">
-                                                <el-option v-for="item in special_select" :label="item"  :value="item"></el-option>
+                                        <el-select v-model="user.special.condition" :multiple="special_select.multi" @change="special_change" placeholder="请选择您符合的加分条件">
+                                                <el-option v-for="(item,index) in special_select.list" :label="item.text"  :value="item.condition"></el-option>
                                         </el-select>
                                     </el-form-item>
                                 @endif
@@ -1408,7 +1408,6 @@
                         return isJPG && isLt2M;
                     },
                     uploadSuccess:function(response, file, fileList){
-                        console.log(this.user)
                         if(response.status){
                             this.user.avatar = response.path;
                         }else{
@@ -2087,6 +2086,10 @@
                         this.user.special.condition = ''
                     @endif
                 },
+                special_change(value){
+                    console.log(this.user.special)
+
+                },
 
                 save(formName){
                     this.user.operation = 1;
@@ -2296,6 +2299,7 @@
                 @if($special_condition_type == 2)
                 if(this.user.post_id > 0){
                     this.special_select = this.post_special[this.user.post_id];
+                    console.log(this.special_select)
                 }
                 @endif
 

+ 6 - 5
resources/views/admin/recruit/index.blade.php

@@ -64,7 +64,7 @@
             '              <th  style="text-align: center;">岗位名称<\/th>' +
             '              <th  style="text-align: center;">招聘人数<\/th>' +
             '              <th  style="text-align: center;">岗位限制条件(JSON格式)<\/th>' +
-            '              <th  style="text-align: center;">岗位加分项,多个条件用,隔开<\/th>' +
+            '              <th  style="text-align: center;">岗位加分项(JSON格式)<\/th>' +
             '              <th  style="text-align: center;"><\/th>' +
             '         <\/tr>' +
             '<tr>' +
@@ -93,7 +93,7 @@
             '              <th  style="text-align: center;">岗位名称<\/th>' +
             '              <th  style="text-align: center;">招聘人数<\/th>' +
             '              <th  style="text-align: center;">限制条件<\/th>' +
-            '              <th  style="text-align: center;">岗位加分项,多个条件用,隔开<\/th>' +
+            '              <th  style="text-align: center;">岗位加分项(JSON格式)<\/th>' +
             '              <th  style="text-align: center;"><\/th>' +
             '         <\/tr>';
         for (var c = 0; c < post.length; c++) {
@@ -101,8 +101,8 @@
                 '              <td  style="padding:8px 15px;"><input type="text"  name="postcode[]" value="' + post[c].code + '" class="form-control postcode"  style="width:100px; " onkeyup="value=value.replace(/[^\\d.]/g,\'\')"  ><\/td>' +
                 '              <td  style="padding:8px 15px;"><input type="text"  name="postname[]" value="' + post[c].name + '" class="form-control postname"   style="width:400px;"  maxlength="80" ><\/td>' +
                 '              <td  style="padding:8px 15px;"><input type="text"  name="postnumber[]" value="' + post[c].number + '" class="form-control postnumber"   style="width:100px;"  maxlength="80" ><\/td>' +
-                '              <td  style="padding:8px 15px;"><input type="text" id="post_' + post[c].id + '"  name="postlimit[]" value="" class="form-control limit"   style="width:400px;" ><\/td>' +
-                '              <td  style="padding:8px 15px;"><input type="text" id="post_' + post[c].id + '"  name="postspecial[]" value="' + post[c].special + '" class="form-control special"   style="width:400px;" ><\/td>'
+                '              <td  style="padding:8px 15px;"><input type="text" id="post_' + post[c].id + '_limit"  name="postlimit[]" value="" class="form-control limit"   style="width:400px;" ><\/td>' +
+                '              <td  style="padding:8px 15px;"><input type="text" id="post_' + post[c].id + '_special"  name="postspecial[]" value="" class="form-control special"   style="width:400px;" ><\/td>'
             ;
             job_base += '                    <\/select>' +
                 '              <\/td>' +
@@ -115,7 +115,8 @@
         job_base += '    <\/table><\/div>';
         $("form .box-body .fields-group").append(job_base);
         for (var c = 0; c < post.length; c++) {
-            $("#post_" + post[c].id).val(post[c].limit);
+            $("#post_" + post[c].id + '_limit').val(post[c].limit);
+            $("#post_" + post[c].id + '_special').val(post[c].special);
         }
     }