瀏覽代碼

获取我的沟通列表

15313670163 3 天之前
父節點
當前提交
7debd6d1d2

+ 45 - 4
app/JsonRpc/NewsService.php

@@ -7,7 +7,6 @@ use App\Model\ArticleData;
 use App\Model\Category;
 use App\Model\WebsiteCategory;
 use App\Model\ArticleSurvey;
-use App\Model\jobHunting;
 use App\Model\District;
 use App\Model\Good;
 use App\Model\JobCompany;
@@ -49,6 +48,7 @@ use Hyperf\Codec\Json;
 
 use App\Tools\buildMenuTree;
 use App\Model\JobApply;
+use App\Model\JobHunting;
 use App\Model\JobRemuse;
 
 #[RpcService(name: "NewsService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
@@ -4560,7 +4560,7 @@ class NewsService implements NewsServiceInterface
         return Result::success($result);
     }
     /*
-    * 获取招聘信息列表
+    * 获取招聘信息列表-职场机会(个人会员收到企业推送岗位)
     * */
     public function getRecruitingList(array $data): array
     {
@@ -4568,10 +4568,11 @@ class NewsService implements NewsServiceInterface
         if (empty($user) || ($user['type_id'] != 10000 && $user['type_id'] != 1)) {
             return Result::error("用户不存在", 0);
         }
-        if ($user['type_id'] == 1) {
+        // 1:个人会员    职场机会
+        if($user['type_id'] == 1){
             $where['user_id'] = $user['id'];
         }
-        $recruitingId = JobApply::when($user['type_id'] == 1, function ($query) use ($user) {
+        $recruitingId = JobResume::when($user['type_id'] == 1, function ($query) use ($user) {
             $query->where('recruit_id', $user['id']);
         })
             ->pluck('recruit_id');
@@ -4657,6 +4658,46 @@ class NewsService implements NewsServiceInterface
         }
         return Result::success($recruiting);
     }
+    /*
+    * 获取企业会员-我的沟通
+    * */
+    public function getJobResumeList(array $data): array
+    {
+        $user = User::where('id', $data['user_id'])->first();
+        if(empty($user) || ($user['type_id']!= 10000 && $user['type_id']!= 3)){
+            return Result::error("用户不存在", 0);
+        }
+        $where = [];
+        if(isset($data['salary']) && $data['salary']!=null){
+            $where['job_hunting.salary'] = $data['salary'];
+        }
+        if(isset($data['user_name']) && $data['user_name']!=null){
+            array_push($where, ['user.user_name', 'like', '%'. $data['user_name']. '%']);
+        }
+        $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');
+        $count = $job->count();
+        if($count == 0){
+            return Result::error("暂无沟通记录", 0);
+        }
+        $jobs = $job->offset(($data['page'] - 1) * $data['pageSize'])
+            ->limit($data['pageSize'])
+            ->get();
+        if (empty($jobs)) {
+            return Result::error("暂无沟通记录", 0);
+        }
+        $result['row'] = $this->processJob($jobs, '');
+        $result['count'] = $count;
+        return Result::success($result);
+    }
     // 20250306 招聘
     //20250422  书刊音像
     public function addBook(array $data): array

+ 5 - 0
app/JsonRpc/NewsServiceInterface.php

@@ -314,6 +314,11 @@ interface NewsServiceInterface
      * @return array
      */
     public function getRecruitingInfo(array $data):array;
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function getJobResumeList(array $data):array;
     /**
      * @param array $data
      * @return array

+ 0 - 63
app/Model/JobHunting.php

@@ -1,63 +0,0 @@
-<?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 = [
-         // 其他可填充字段
-         'id',
-         'imgurl',
-         'cat_arr_id',
-         'name',
-         'sexy',
-         'self_evaluation',
-         'jobtime',
-         'phone',
-         'wx',
-         'birth',
-         'educational',
-         'marriage',
-         'politic',
-         'origin',
-         'language',
-         'level',
-         'industry',
-         'job',
-         'job_name_get',
-         'experience',
-         'company_nature',
-         'salary',
-         'skillList',
-         'slelf_evaluation',
-         'job_experience',
-         'education_experience',
-         'city_arr_id',
-         'city_id',
-         'website_id',
-         'user_id',
-         'catid',
-         'status',
-         'created_at',
-         'updated_at',
-    ];
-
-    /**
-     * The attributes that should be cast to native types.
-     */
-    protected array $casts = [];
-}

+ 27 - 0
app/Model/JobResume.php

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

+ 0 - 63
app/Model/jobHunting.php

@@ -1,63 +0,0 @@
-<?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 = [
-         // 其他可填充字段
-         'id',
-         'imgurl',
-         'cat_arr_id',
-         'name',
-         'sexy',
-         'self_evaluation',
-         'jobtime',
-         'phone',
-         'wx',
-         'birth',
-         'educational',
-         'marriage',
-         'politic',
-         'origin',
-         'language',
-         'level',
-         'industry',
-         'job',
-         'job_name_get',
-         'experience',
-         'company_nature',
-         'salary',
-         'skillList',
-         'slelf_evaluation',
-         'job_experience',
-         'education_experience',
-         'city_arr_id',
-         'city_id',
-         'website_id',
-         'user_id',
-         'catid',
-         'status',
-         'created_at',
-         'updated_at',
-    ];
-
-    /**
-     * The attributes that should be cast to native types.
-     */
-    protected array $casts = [];
-}

+ 2 - 2
app/Model/jobResume.php

@@ -8,7 +8,7 @@ use Hyperf\DbConnection\Model\Model;
 
 /**
  */
-class jobResume extends Model
+class JobResume extends Model
 {
     /**
      * The table associated with the model.
@@ -18,7 +18,7 @@ class jobResume extends Model
     /**
      * The attributes that are mass assignable.
      */
-    protected array $guarded = [];
+    protected array $fillable = [];
 
     /**
      * The attributes that should be cast to native types.