Просмотр исходного кода

Merge branch 'master' of http://git.bjzxtw.org.cn:3000/zxt/news_producer

LiuJ 3 дней назад
Родитель
Сommit
7597723851
1 измененных файлов с 17 добавлено и 12 удалено
  1. 17 12
      app/JsonRpc/NewsService.php

+ 17 - 12
app/JsonRpc/NewsService.php

@@ -2209,9 +2209,9 @@ class NewsService implements NewsServiceInterface
                 }
                 $job->pinyin = $pinyin;
             }
-            // 取城市-市??省
-            if (!empty($city) && is_array($city)) {
-                if (isset($city[1]) && !empty($city[1])) {
+            // 取职位-城市  市??省
+            if(!empty($city) && is_array($city)){
+                if(isset($city[1] ) && !empty($city[1])){
                     $city = District::where('id', $city[1])->first(['name']);
                     $job->city_name = $city->name ?? '';
                 } else if (isset($city[0]) && !empty($city[0])) {
@@ -2221,8 +2221,13 @@ class NewsService implements NewsServiceInterface
                     $job->city_name = '全国';
                 }
             }
-            // 取公司地址
-            if (isset($job->address_arr_id) && !empty($job->address_arr_id)) {
+            // 获取简历最后一级地区
+            if(isset($job->city_id) &&!empty($job->city_id)){
+                $city = District::where('id', $job->city_id)->first(['name']);
+                $job->hunt_cityname = $city->name?? '';
+            }
+            // 组合详细地址
+            if(isset($job->address_arr_id) && !empty($job->address_arr_id)){
                 $address_id = json_decode($job->address_arr_id, true) ?? [];
                 if (is_array($address_id) && !empty($address_id)) {
                     $address = District::whereIn('id', $address_id)
@@ -4750,13 +4755,13 @@ class NewsService implements NewsServiceInterface
         $job = JobResume::when($user['type_id'] == 3, function ($query) use ($user) {
             $query->where('job_resume.user_id', $user['id']);
         })
-            ->when(!empty($where), function ($query) use ($where) {
-                $query->where($where);
-            })
-            ->leftJoin('job_hunting', 'job_hunting.id', 'job_resume.hunt_id')
-            ->leftJoin('job_recruiting', 'job_recruiting.id', 'job_resume.recruit_id')
-            ->leftJoin('user', 'user.id', 'job_resume.receiver_id')
-            ->select('job_resume.hunt_id', 'job_resume.recruit_id', 'job_hunting.id', 'job_hunting.salary', 'job_hunting.city_id', 'job_recruiting.jtzw_id', 'user.user_name');
+        ->when(!empty($where), function ($query) use ($where) {
+            $query->where($where);
+        })
+        ->leftJoin('job_hunting','job_hunting.id','job_resume.hunt_id')
+        ->leftJoin('job_recruiting','job_recruiting.id','job_resume.recruit_id')
+        ->leftJoin('user','user.id','job_resume.receiver_id')
+        ->select('job_resume.hunt_id','job_resume.recruit_id','job_hunting.id','job_hunting.salary','job_hunting.city_id','job_hunting.updated_at','job_recruiting.jtzw_id','user.user_name');
         $count = $job->count();
         if ($count == 0) {
             return Result::error("暂无沟通记录", 0);