LiuJ 3 өдөр өмнө
parent
commit
80bc221fd5

+ 17 - 13
app/JsonRpc/NewsService.php

@@ -2210,8 +2210,8 @@ 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])) {
@@ -2222,12 +2222,12 @@ class NewsService implements NewsServiceInterface
                 }
             }
             // 获取简历最后一级地区
-            if(isset($job->city_id) &&!empty($job->city_id)){
+            if (isset($job->city_id) && !empty($job->city_id)) {
                 $city = District::where('id', $job->city_id)->first(['name']);
-                $job->hunt_cityname = $city->name?? '';
+                $job->hunt_cityname = $city->name ?? '';
             }
             // 组合详细地址
-            if(isset($job->address_arr_id) && !empty($job->address_arr_id)){
+            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)
@@ -3279,11 +3279,15 @@ class NewsService implements NewsServiceInterface
             return Result::error("查询失败", 0);
         }
         $count = jobApply::where($where)
+            ->where('job_enum.egroup', '=', 'income')
+            ->where('job_hunting.status', 2) //已审核
             ->leftJoin('job_hunting', 'job_hunting.id', '=', 'job_apply.hunt_id')
             ->leftJoin('district', 'district.id', '=', 'job_hunting.city_id')
             ->leftJoin('job_enum', 'job_enum.evalue', '=', 'job_hunting.salary')
             ->leftJoin('user', 'job_hunting.user_id', '=', 'user.id')
-            ->select('job_apply.*', 'job_hunting.job_name_get as job_name', 'job_hunting.salary as salary', 'district.name as cityname', 'job_enum.ename as salary_name', 'user.nickname as nickname', 'user.user_name as username')
+            //职位----是申请职位
+            ->leftJoin('job_position', 'job_hunting.job_name_get', '=', 'job_position.zwid')
+            ->select('job_apply.*', 'job_position.zwname as job_name', 'job_hunting.salary as salary', 'district.name as cityname', 'job_enum.ename as salary_name', 'user.nickname as nickname', 'user.user_name as username', 'job_hunting.updated_at as updated_at')
             ->count();
         $data = [
             'rows' => $result->toArray(),
@@ -4755,13 +4759,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_hunting.updated_at','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);

+ 27 - 0
app/Model/JobHunting.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class JobHunting extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'job_hunting';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}