瀏覽代碼

更新两码上传

sandm 2 年之前
父節點
當前提交
86cb206bd1
共有 1 個文件被更改,包括 3 次插入11 次删除
  1. 3 11
      app/Http/Controllers/Web/Recruit/IndexController.php

+ 3 - 11
app/Http/Controllers/Web/Recruit/IndexController.php

@@ -1893,10 +1893,10 @@ class IndexController extends WebBaseController
         $appoint_id = $request->input('appoint_id');
         $type = $request->input('type');
         $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('id',$appoint_id)->first();
-        $recruit = Recruit::where('id',$appoint_info->recruit_id)->first();
         if(!$appoint_info){
             return ['status' => 0, 'msg' => '抱歉,找不到您要登记的报名记录!'];
         }
+        $recruit = Recruit::where('id',$appoint_info->recruit_id)->first();
         $info = RecruitSupplement::where('appoint_id',$appoint_id)->where('type',$type)->first();
         if($info){
             if($info->h_status == 1){
@@ -1950,6 +1950,7 @@ class IndexController extends WebBaseController
             $health_result = $this->baiduService->health_code(file_get_contents(base_path() . "/public" . $health_code[0]['response']['path']));
             $health_msg = [];
             $h_status = 1;
+            $appoint_info->health_audit = 1;
             if(!array_key_exists('error_msg',$health_result) && !array_key_exists('error_code',$health_result)){
                 if(array_key_exists('姓名',$health_result)){
                     if(stripos($health_result['姓名'][0]['word'],'*')>0){
@@ -1957,38 +1958,29 @@ class IndexController extends WebBaseController
                     }
                     if($health_result['姓名'][0]['word'] != $appoint_info->realname){
                         array_push($health_msg,'抱歉,请上传您本人的健康码!');
-                        $h_status = 0;
                     }
                 }else{
                     array_push($health_msg,'健康码错误,识别不到姓名!');
-                    $h_status = 0;
                 }
                 if(array_key_exists('状态',$health_result)){
                     if($health_result['状态'][0]['word'] != '绿码'){
                         array_push($health_msg,'抱歉,您的健康码非绿码!');
-                        $h_status = 0;
                     }
                 }else{
                     array_push($health_msg,'健康码错误,识别不到状态!');
-                    $h_status = 0;
                 }
                 if(array_key_exists('更新时间',$health_result)){
                     $time = strtotime($health_result['更新时间'][0]['word']);
                     if($time < strtotime($recruit->pen_health_start) || $time > strtotime($recruit->pen_health_end)){
                         array_push($health_msg,'抱歉,请上传{$recruit->pen_health_start}至{$recruit->pen_health_end}之间的健康码!');
-                        $h_status = 0;
                     }
                 }else{
                     array_push($health_msg,'健康码错误,识别不到时间!');
-                    $h_status = 0;
                 }
                 $data['h_status'] = $h_status;
                 $data['h_msg'] = $h_status == 1 ? '健康码自动审核通过' : implode(';',$health_msg);
                 $appoint_info->health_audit = $h_status == 1 ? 1 : 4;
                 $data['health_code'] = json_encode($health_code);
-            }else{
-                $data['h_status'] = 0;
-                $appoint_info->health_audit = $h_status == 4;
             }
 
             $data['health_result'] = json_encode($health_result);
@@ -2025,7 +2017,7 @@ class IndexController extends WebBaseController
                         $trip_status = 0;
                     }
                 }
-                $data['h_msg'] = implode(';',$trip_msg);
+                $data['h_msg'] .= implode(';',$trip_msg);
             }
 
             $data['trip_result'] = json_encode($trip_result);