Browse Source

增加承诺书模块

sandm 1 year ago
parent
commit
11b201cfd0

+ 40 - 1
app/Admin/Controllers/Recruit/RecruitController.php

@@ -238,7 +238,7 @@ class RecruitController extends Controller
             $form->number('ordid', '排序')->default(0);
             $form->number('ordid', '排序')->default(0);
             $form->multipleFile('addFile', '附件')->move('storage/app/public/recruit/' . time());
             $form->multipleFile('addFile', '附件')->move('storage/app/public/recruit/' . time());
         })->tab('报名表单与条件', function ($form) {
         })->tab('报名表单与条件', function ($form) {
-            $form->checkbox('forms', '报名表单模块')->options(['basic' => '基础信息模块','expand_special' => '扩展模块-加分','detail' => '详情介绍模块','identification' => '身份证明上传模块','education_certification' => '学历证明上传模块','other_certification' => '其他证明上传模块', 'remark' => '备注模块','internship' => '实习专场'])->default(['basic'])->setMustMark();
+            $form->checkbox('forms', '报名表单模块')->options(['basic' => '基础信息模块','expand_special' => '扩展模块-加分','detail' => '详情介绍模块','identification' => '身份证明上传模块','education_certification' => '学历证明上传模块','other_certification' => '其他证明上传模块', 'remark' => '备注模块','chengnuoshu'=>'诚信承诺书','internship' => '实习专场'])->default(['basic'])->setMustMark();
             $form->text('limit_times', '报名次数限制')->rules('required|regex:/^\d+$/', [
             $form->text('limit_times', '报名次数限制')->rules('required|regex:/^\d+$/', [
                 'required' => '报名限制次数必须填写',
                 'required' => '报名限制次数必须填写',
                 'regex' => '次数必须为数字'
                 'regex' => '次数必须为数字'
@@ -890,6 +890,29 @@ class RecruitController extends Controller
                 $data->other_certification = [];
                 $data->other_certification = [];
             }
             }
         }
         }
+        if(in_array('chengnuoshu',$recruit->forms) || in_array('internship',$recruit->forms)){
+            if(json_decode($data->chengnuoshu)){
+                $data->chengnuoshu = json_decode($data->chengnuoshu);
+                $photo_data = [];
+                foreach ($data->chengnuoshu as $k => $v) {
+                    if($v->status){
+                        $photo_data[] = [
+                            'alt' => $v->name,
+                            'pid' => $v->uid,
+                            'src' => $v->response->path,
+                        ];
+                    }
+                }
+                $photos['chengnuoshu'] = [
+                    'title' => '诚信承诺书',
+                    'id' => 1,
+                    'start' => 0,
+                    'data' =>$photo_data
+                ];
+            }else{
+                $data->chengnuoshu = [];
+            }
+        }
 
 
         $html = view('admin.recruit.manageajax_userinfo')->with(['appointinfo' => $data,'recruit' => $recruit,'photos'=>$photos])->render();
         $html = view('admin.recruit.manageajax_userinfo')->with(['appointinfo' => $data,'recruit' => $recruit,'photos'=>$photos])->render();
         return response()->json(['code' => 1, 'data' => $html]);
         return response()->json(['code' => 1, 'data' => $html]);
@@ -2090,6 +2113,9 @@ class RecruitController extends Controller
             if(in_array('other_certification',explode(',', $recruit->forms)) || in_array('internship',explode(',', $recruit->forms))){
             if(in_array('other_certification',explode(',', $recruit->forms)) || in_array('internship',explode(',', $recruit->forms))){
                 $header[] = '其他证明';
                 $header[] = '其他证明';
             }
             }
+            if(in_array('chengnuoshu',explode(',', $recruit->forms))){
+                $header[] = '诚信承诺书';
+            }
             $header[] = '审核状态';
             $header[] = '审核状态';
             $header[] = '审核意见';
             $header[] = '审核意见';
 //            if(in_array('3',explode(',', $recruit->step))){
 //            if(in_array('3',explode(',', $recruit->step))){
@@ -2327,6 +2353,19 @@ class RecruitController extends Controller
 
 
                     array_push($item, implode("\r\n", $other_certifications));
                     array_push($item, implode("\r\n", $other_certifications));
                 }
                 }
+                if (in_array('chengnuoshu', explode(',', $recruit->forms))) {
+                    $chengnuoshu = json_decode($v->chengnuoshu, true);
+                    $chengnuoshu = [];
+                    if($chengnuoshu){
+                        foreach ($chengnuoshu as $val){
+                            if(array_key_exists('path', $val['response'])){
+                                array_push($chengnuoshu,"https://www.jucai.gov.cn" . $val['response']['path']);
+                            }
+                        }
+                    }
+
+                    array_push($item, implode("\r\n", $chengnuoshu));
+                }
                 switch (intval($v->audit)){
                 switch (intval($v->audit)){
                     case 1:
                     case 1:
                         $item[] = '审核中';
                         $item[] = '审核中';

+ 72 - 1
app/Http/Controllers/Web/Recruit/IndexController.php

@@ -444,6 +444,19 @@ class IndexController extends WebBaseController
                 }
                 }
                 $user_info['other_certification'] = $other_certification;
                 $user_info['other_certification'] = $other_certification;
 
 
+                if(json_decode($user_info['chengnuoshu'])){
+                    $chengnuoshu = json_decode($user_info['chengnuoshu'],true);
+                    foreach ($chengnuoshu as $k => $v){
+                        if(array_key_exists('response',$v)){
+                            $chengnuoshu[$k]['url'] = $v['response']['path'];
+                        }
+
+                    }
+                }else{
+                    $chengnuoshu = [];
+                }
+                $user_info['chengnuoshu'] = $chengnuoshu;
+
                 //获取最新的报名审核信息
                 //获取最新的报名审核信息
                 $logs = RecruitAppointLog::where('appoint_id',$user_info->id)->where('step',1)->where('type',2)->orderBy('created_at','desc')->first();
                 $logs = RecruitAppointLog::where('appoint_id',$user_info->id)->where('step',1)->where('type',2)->orderBy('created_at','desc')->first();
                 if($logs){
                 if($logs){
@@ -549,6 +562,24 @@ class IndexController extends WebBaseController
                     $user_info['other_certification'] = $other_certification;
                     $user_info['other_certification'] = $other_certification;
                 }
                 }
 
 
+                //如果有承诺书模块
+                if(in_array('chengnuoshu',$forms)){
+                    if(json_decode($user_info['chengnuoshu'])){
+                        $chengnuoshu = json_decode($user_info['chengnuoshu'],true);
+                        foreach ($chengnuoshu as $k => $v){
+                            if(array_key_exists('response',$v)){
+                                if(array_key_exists('path',$v['response'])){
+                                    $chengnuoshu[$k]['url'] = $v['response']['path'];
+                                }
+                            }
+
+                        }
+                    }else{
+                        $chengnuoshu = [];
+                    }
+                    $user_info['chengnuoshu'] = $chengnuoshu;
+                }
+
                 //获取最新的报名审核信息
                 //获取最新的报名审核信息
                 $logs = RecruitAppointLog::where('appoint_id',$user_info->id)->where('step',1)->where('type',2)->orderBy('created_at','desc')->first();
                 $logs = RecruitAppointLog::where('appoint_id',$user_info->id)->where('step',1)->where('type',2)->orderBy('created_at','desc')->first();
                 if($logs){
                 if($logs){
@@ -606,7 +637,8 @@ class IndexController extends WebBaseController
                     ],
                     ],
                     'identification' => [],
                     'identification' => [],
                     'education_certification' => [],
                     'education_certification' => [],
-                    'other_certification' => []
+                    'other_certification' => [],
+                    'chengnuoshu' => []
                 ]);
                 ]);
             }else{
             }else{
                 //如果没有,结合基础数据及模块表单信息,制作数据对象
                 //如果没有,结合基础数据及模块表单信息,制作数据对象
@@ -641,6 +673,9 @@ class IndexController extends WebBaseController
                 if(in_array('other_certification',$forms)){
                 if(in_array('other_certification',$forms)){
                     $user_info['other_certification'] = [];
                     $user_info['other_certification'] = [];
                 }
                 }
+                if(in_array('chengnuoshu',$forms)){
+                    $user_info['chengnuoshu'] = [];
+                }
                 $user_info['recruit_id'] = $id;
                 $user_info['recruit_id'] = $id;
                 $user_info['operation'] = 1;
                 $user_info['operation'] = 1;
             }
             }
@@ -974,6 +1009,24 @@ class IndexController extends WebBaseController
                             $appoint_info->save();
                             $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($chengnuoshu){
+                            $appoint_info->chengnuoshu = json_encode($chengnuoshu);
+                            $appoint_info->save();
+                        }
+                    }
                     DB::commit();
                     DB::commit();
                     if($operation == 2){
                     if($operation == 2){
                         $log = [
                         $log = [
@@ -1079,6 +1132,24 @@ class IndexController extends WebBaseController
                             $result->save();
                             $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();
+                        }
+                    }
                     DB::commit();
                     DB::commit();
                     if($operation == 2){
                     if($operation == 2){
                         $log = [
                         $log = [

File diff suppressed because it is too large
+ 25985 - 0
laravel.log


Some files were not shown because too many files changed in this diff