Bläddra i källkod

更新验证码逻辑

zmw 1 år sedan
förälder
incheckning
8e60e607a6

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

@@ -246,6 +246,7 @@ class RecruitController extends Controller
             $form->text('contact', '联系人');
             $form->text('phone', '联系电话');
             $form->text('host_address', '联系地址');
+            $form->image('qr_code', '联系人二维码');
             //$form->switch('predetermined_status', '是否允许报名')->states($display_option)->default(1)->setMustMark();
             $form->number('ordid', '排序')->default(0);
             $form->multipleFile('addFile', '附件')->move('storage/app/public/recruit/' . time());
@@ -404,6 +405,12 @@ class RecruitController extends Controller
         if($verify['phone']){
             $data['phone'] = $verify['phone'];
         }
+        if(array_key_exists('qr_code',$verify)){
+            $data['qr_code'] = "/storage/" . $verify['qr_code'];
+        }
+        if($verify['addFile']){
+            $data['addFile'] = $verify['addFile'];
+        }
         $data['ordid'] = $verify['ordid'];
         $data['limit_times'] = $verify['limit_times'];
         $data['post_times'] = $verify['post_times'];
@@ -582,6 +589,10 @@ class RecruitController extends Controller
         $data['supplement_end'] = $verify['supplement_end'] ? $verify['supplement_end'] : null;
         $data['introduction'] = $verify['introduction'];
         $data['host_address'] = $verify['host_address'];
+        if(array_key_exists('qr_code',$verify)){
+            $data['qr_code'] = "/storage/" . $verify['qr_code'];
+        }
+        //$data['addFile'] = $verify['addFile'];
         $data['contact'] = $verify['contact'];
         $data['phone'] = $verify['phone'];
         $data['ordid'] = $verify['ordid'];
@@ -615,12 +626,14 @@ class RecruitController extends Controller
         $data['reexamine_ticket_content'] = $verify['reexamine_ticket_content'];
         $data['reexamine_field'] = implode(',',$verify['reexamine_field']);
         $ids = RecruitPost::where('recruit_id', $recruit_id)->pluck('id');
-        $fileCharater = $request->input('addFile');
+        //$fileCharater = $request->input('addFile');
         $data['special'] = 0;
 
+
         DB::beginTransaction();//检查数据库事务
         try {
             $res = Recruit::where('id', $recruit_id)->update($data);
+
             $postcode_array = $request->postcode;
             $postname_array = $request->postname;
             $postnumber_array = $request->postnumber;
@@ -696,6 +709,7 @@ class RecruitController extends Controller
             return admin_toastr('操作成功!', 'success');
 
         } catch (\Exception $e) {
+
             DB::rollback();
             return admin_toastr($e->getMessage(), 'error');
         }

+ 15 - 2
app/Http/Controllers/Web/Recruit/IndexController.php

@@ -1231,7 +1231,13 @@ class IndexController extends WebBaseController
                         'log'       =>  '用户提交报名'
                     ];
                     RecruitAppointLog::create($log);
-                    return ['status' => 1, 'msg' => '提交成功', 'data' => $appoint_info->id];
+                    if(empty($recruit->qr_code)){
+                        return ['status' => 1, 'msg' => '提交成功', 'data' => $appoint_info->id, 'is_html' => 0];
+
+                    }else{
+                        return ['status' => 1, 'msg' => "<h3 style='text-align: center'>提交成功,添加工作人员企业微信了解后续信息</h3><p><img src='{$recruit->qr_code}' width='240' height='240' /></p>", 'data' => $appoint_info->id,'is_html' => 1];
+
+                    }
                 }else{
                     return ['status' => 1, 'msg' => '资料保存成功,请尽快完善并提交', 'data' => $appoint_info->id];
                 }
@@ -1432,7 +1438,14 @@ class IndexController extends WebBaseController
                         'log'       =>  '用户首次提交报名'
                     ];
                     RecruitAppointLog::create($log);
-                    return ['status' => 1, 'msg' => '提交成功', 'data' => $result->id];
+                    if(empty($recruit->qr_code)){
+                        return ['status' => 1, 'msg' => '提交成功', 'data' => $appoint_info->id, 'is_html' => 0];
+
+                    }else{
+                        return ['status' => 1, 'msg' => "<h3 style='text-align: center'>提交成功,添加工作人员企业微信了解后续信息</h3><p><img src='{$recruit->qr_code}' width='240' height='240' /></p>", 'data' => $appoint_info->id,'is_html' => 1];
+
+                    }
+                    //return ['status' => 1, 'msg' => '提交成功', 'data' => $result->id];
                 }else{
                     return ['status' => 1, 'msg' => '资料保存成功,请尽快完善并提交', 'data' => $result->id];
                 }

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

@@ -1632,12 +1632,22 @@
 
                                     axios.post("{{route('recruit.save_sign_up')}}",Qs.stringify(this.user)).then(response => {
                                         if(response.data.status){
-                                            this.$alert(response.data.msg, '提交成功', {
-                                                confirmButtonText: '确定',
-                                                callback: action => {
-                                                    window.location.reload();
-                                                }
-                                            });
+                                            if(response.data.is_html == 1){
+                                                this.$alert(response.data.msg, '提交成功', {
+                                                    dangerouslyUseHTMLString: true,
+                                                    confirmButtonText: '确定',
+                                                    callback: action => {
+                                                        window.location.reload();
+                                                    }
+                                                });
+                                            }else{
+                                                this.$alert(response.data.msg, '提交成功', {
+                                                    confirmButtonText: '确定',
+                                                    callback: action => {
+                                                        window.location.reload();
+                                                    }
+                                                });
+                                            }
                                         }else{
                                             this.$message.error(response.data.msg);
                                             this.loading.close();