浏览代码

更新招考系统证件判断

sandm 1 年之前
父节点
当前提交
f2ae9847f4
共有 1 个文件被更改,包括 70 次插入69 次删除
  1. 70 69
      app/Http/Controllers/Web/Recruit/IndexController.php

+ 70 - 69
app/Http/Controllers/Web/Recruit/IndexController.php

@@ -874,8 +874,7 @@ class IndexController extends WebBaseController
             $data['audit'] = 1;//提交
         }
 
-
-
+        if(strlen($data['card']) == 18){
             //身份证判断出生日期和性别
             $year = substr($data['card'],6,4);
             $month = substr($data['card'],10,2);
@@ -888,78 +887,80 @@ class IndexController extends WebBaseController
             }else{
                 $data['sex'] = 1;
             }
+        }
 
-            if(!empty($post_info['limit']) && json_decode($post_info['limit'])){
-                //岗位限制条件的判断
-                $post_limit = json_decode($post_info['limit'],true);
-                if(is_array($post_limit)){
-                    foreach($post_limit as $k => $v){
-                        if($k == 'birthday'){
-                            $value = str_replace('-','',$data[$k]);
-                        }else{
-                            $value = $data[$k];
-                        }
-                        switch ($v['op']){
-                            case '=':
-                                if($value != $v['value']){
-                                    return response()->json(['status' => 0,'msg' => $v['msg']]);
-                                }
-                                break;
-                            case '>':
-                                if($value <= $v['value']){
-                                    return response()->json(['status' => 0,'msg' => $v['msg']]);
-                                }
-                                break;
-                            case '>=':
-                                if($value < $v['value']){
-                                    return response()->json(['status' => 0,'msg' => $v['msg']]);
-                                }
-                                break;
-                            case '<':
-                                if($value >= $v['value']){
-                                    return response()->json(['status' => 0,'msg' => $v['msg']]);
-                                }
-                                break;
-                            case '<=':
-                                if($value > $v['value']){
-                                    return response()->json(['status' => 0,'msg' => $v['msg']]);
-                                }
-                                break;
-                            case '!=':
-                                if($value == $v['value']){
-                                    return response()->json(['status' => 0,'msg' => $v['msg']]);
-                                }
-                                break;
-                            case 'like':
-                                if(strpos($value,$v['value']) === false){
-                                    return response()->json(['status' => 0,'msg' => $v['msg']]);
-                                }
-                                break;
-                            case 'in':
-                                if(strpos($v['value'],$value) === false){
-                                    return response()->json(['status' => 0,'msg' => $v['msg']]);
-                                }
-                                break;
-                        }
+
+        if(!empty($post_info['limit']) && json_decode($post_info['limit'])){
+            //岗位限制条件的判断
+            $post_limit = json_decode($post_info['limit'],true);
+            if(is_array($post_limit)){
+                foreach($post_limit as $k => $v){
+                    if($k == 'birthday'){
+                        $value = str_replace('-','',$data[$k]);
+                    }else{
+                        $value = $data[$k];
+                    }
+                    switch ($v['op']){
+                        case '=':
+                            if($value != $v['value']){
+                                return response()->json(['status' => 0,'msg' => $v['msg']]);
+                            }
+                            break;
+                        case '>':
+                            if($value <= $v['value']){
+                                return response()->json(['status' => 0,'msg' => $v['msg']]);
+                            }
+                            break;
+                        case '>=':
+                            if($value < $v['value']){
+                                return response()->json(['status' => 0,'msg' => $v['msg']]);
+                            }
+                            break;
+                        case '<':
+                            if($value >= $v['value']){
+                                return response()->json(['status' => 0,'msg' => $v['msg']]);
+                            }
+                            break;
+                        case '<=':
+                            if($value > $v['value']){
+                                return response()->json(['status' => 0,'msg' => $v['msg']]);
+                            }
+                            break;
+                        case '!=':
+                            if($value == $v['value']){
+                                return response()->json(['status' => 0,'msg' => $v['msg']]);
+                            }
+                            break;
+                        case 'like':
+                            if(strpos($value,$v['value']) === false){
+                                return response()->json(['status' => 0,'msg' => $v['msg']]);
+                            }
+                            break;
+                        case 'in':
+                            if(strpos($v['value'],$value) === false){
+                                return response()->json(['status' => 0,'msg' => $v['msg']]);
+                            }
+                            break;
                     }
                 }
             }
-            //前置审核 判断完成,先将数据入报名信息基础表
-            //解析家庭成员数据
-            $familys = $request->input('family');
-            $family = [];
-            if(is_array($familys)){
-                foreach ($familys as $value){
-                    $item = [
-                        'relation'  =>  $value['relation'],
-                        'realname'  =>  $value['realname'],
-                        'birthday'  =>  $value['birthday'],
-                        'political_affiliation' =>  $value['political_affiliation'],
-                        'work'  =>  $value['work']
-                    ];
-                    array_push($family,$item);
-                }
+        }
+        //前置审核 判断完成,先将数据入报名信息基础表
+        //解析家庭成员数据
+        $familys = $request->input('family');
+        $family = [];
+        if(is_array($familys)){
+            foreach ($familys as $value){
+                $item = [
+                    'relation'  =>  $value['relation'],
+                    'realname'  =>  $value['realname'],
+                    'birthday'  =>  $value['birthday'],
+                    'political_affiliation' =>  $value['political_affiliation'],
+                    'work'  =>  $value['work']
+                ];
+                array_push($family,$item);
             }
+        }
 
             $data['family'] = json_encode($family);
             if($appoint_info){