Explorar el Código

修改b端添加职位的接口-改变它的默认工作经验

15313670163 hace 1 semana
padre
commit
3f963988f7
Se han modificado 1 ficheros con 10 adiciones y 2 borrados
  1. 10 2
      app/JsonRpc/NewsService.php

+ 10 - 2
app/JsonRpc/NewsService.php

@@ -1167,7 +1167,11 @@ class NewsService implements NewsServiceInterface
             // 先添加职位相关信息
             if($user['type_id'] == 10000){
                $job['status'] = 1;  
-               $job['experience'] = $data['experience']?? 0;
+            }
+            if(empty($data['experience']) || $data['experience'] == ''){
+                $job['experience'] = null;
+            }else{
+                $job['experience'] = $data['experience'];
             }
             $jobId = JobRecruiting::insertGetId($job);
             if (empty($jobId)) {
@@ -1334,7 +1338,11 @@ class NewsService implements NewsServiceInterface
             }else{
                 $data['status'] = 0;
             }
-            $job['experience'] = $data['experience']?? 0;
+            if(empty($data['experience']) || $data['experience'] == ''){
+                $job['experience'] = null;
+            }else{
+                $job['experience'] = $data['experience'];
+            }
             // Db::rollBack();
             // return Result::success($company);
             $result['job'] = JobRecruiting::where('id', $jobId)->update($data);