LiuJ 1 天之前
父節點
當前提交
f625cbc66a
共有 3 個文件被更改,包括 80 次插入1 次删除
  1. 51 0
      app/JsonRpc/NewsService.php
  2. 2 1
      app/JsonRpc/NewsServiceInterface.php
  3. 27 0
      app/Model/jobResume.php

+ 51 - 0
app/JsonRpc/NewsService.php

@@ -25,6 +25,8 @@ use App\Model\News;
 use App\Model\UserInfo;
 use App\Model\WebsiteGroup;;
 
+use App\Model\jobResume;
+
 use Hyperf\DbConnection\Db;
 use Hyperf\RpcServer\Annotation\RpcService;
 use App\Tools\Result;
@@ -2305,6 +2307,55 @@ class NewsService implements NewsServiceInterface
         ];
         return Result::success($data);
     }
+    public function getJobHuntingApply(array $data): array
+    {
+        $where = [];
+
+        if (isset($data['username']) && !empty($data['username'])) {
+            $where[] = ['user.user_name', 'like', '%' . $data['username'] . '%'];
+        }
+        if (isset($data['salary']) && !empty($data['salary'])) {
+            $where = [
+                'job_hunting.salary' => $data['salary'],
+            ];
+        }
+        $type_id = isset($data['type_id']) ? $data['type_id'] : '';
+        $user_id = isset($data['user_id']) ? $data['user_id'] : '';
+        unset($data['type_id']);
+        if ($type_id != '10000') {
+            $where[] = ['job_resume.user_id', '=', $user_id];
+        }
+        $result = jobResume::where($where)
+            // ->when(!empty($data['status1']), function ($query) use ($data) {
+            //     return $query->whereIn('job_hunting.status', [1, 3]);   //1待审核2已审核3已拒绝
+            // })
+            // ->leftJoin('user', 'user.id', '=', 'job_hunting.user_id') 'user.nickname as nickname',  , 'user.user_name as username'
+            ->where('job_enum.egroup', '=', 'income')
+            ->leftJoin('job_hunting', 'job_hunting.id', '=', 'job_resume.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_resume.*', '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')
+            ->orderBy("job_resume.updated_at", "desc")
+            ->limit($data['page_size'])
+            ->offset(($data['page'] - 1) * $data['page_size'])
+            ->get();
+        if (empty($result)) {
+            return Result::error("查询失败", 0);
+        }
+        $count = jobResume::where($where)
+            ->leftJoin('job_hunting', 'job_hunting.id', '=', 'job_resume.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_resume.*', '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')
+            ->count();
+        $data = [
+            'rows' => $result->toArray(),
+            'count' => $count,
+        ];
+        return Result::success($data);
+    }
     public function addJobHunting(array $data): array
     {
         date_default_timezone_set('Asia/Shanghai');

+ 2 - 1
app/JsonRpc/NewsServiceInterface.php

@@ -102,6 +102,7 @@ interface NewsServiceInterface
     //20250226  产品列表
     //20250306  求职信息
     public function getJobHuntingList(array $data): array;
+    public function getJobHuntingApply(array $data): array;
     public function getJobHuntingInfo(array $data): array;
     public function addJobHunting(array $data): array;
     public function delJobHunting(array $data): array;
@@ -302,5 +303,5 @@ interface NewsServiceInterface
      * @param array $data
      * @return array
      */
-    public function getWebsiteshop(array $data):array;
+    public function getWebsiteshop(array $data): array;
 }

+ 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 $guarded = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}