Przeglądaj źródła

修改加分项选择

sandm 1 rok temu
rodzic
commit
956a692dee

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

@@ -941,6 +941,8 @@ class IndexController extends WebBaseController
         }
 
 
+
+
         if(!empty($post_info['limit']) && json_decode($post_info['limit'])){
             //岗位限制条件的判断
             $post_limit = json_decode($post_info['limit'],true);
@@ -1012,6 +1014,13 @@ class IndexController extends WebBaseController
                 array_push($family,$item);
             }
         }
+        $forms = explode(',', $recruit['forms']);
+        if(in_array('expand_special',$forms)){
+            $special = $request->input('special');
+            if($special['point_apply'] && $special['condition'] == ''){
+                return response()->json(['status' => 0,'msg' => '加分条件不能为空']);
+            }
+        }
 
             $data['family'] = json_encode($family);
             if($appoint_info){
@@ -1020,7 +1029,7 @@ class IndexController extends WebBaseController
                 try{
                     RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$recruit_id)->update($data);
                     //分模块解析数据
-                    $forms = explode(',', $recruit['forms']);
+
                     //如果有加分模块
                     if(in_array('expand_special',$forms)){
                         $special = $request->input('special');

+ 5 - 4
public/themes/default/views/app/recruit/sign_up.blade.php

@@ -1940,7 +1940,7 @@
                 },
                 validSpecialCondition(rule, value, callback){
                     if(this.user.special.point_apply == 1 && this.user.special.condition == ''){
-                        callback(new Error('请输入符合加分的条件'));
+                        callback(new Error('请输入/选择符合加分的条件'));
                     }else{
                         callback();
                     }
@@ -2082,9 +2082,10 @@
                 },
                 postChange(value){
                     this.post_limit_value = this.post_limit[value];
-                    this.special_select = this.post_special[value];
-                    console.log(this.special_select)
-                    console.log(this.post_special)
+                    @if($special_condition_type == 2)
+                        this.special_select = this.post_special[value];
+                        this.user.special.condition = ''
+                    @endif
                 },
 
                 save(formName){