Эх сурвалжийг харах

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

LiuJ 4 өдөр өмнө
parent
commit
e1da9b591f

+ 94 - 62
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")]
@@ -1924,64 +1924,55 @@ class NewsService implements NewsServiceInterface
         $data = json_decode($input['id'] ?? '', true) ?? [];
         $result['goods'] = array_map(function ($item) use ($input) {
             // 检查parent元素是否存在且不是undefined
-            if (isset($item['level']) && $item['level'] != 'undefined' && $item['level'] != "") {
-                list($Levelid, $goodStart, $goodNum) = explode(',', $item['level']);
-                $website = $input['website_id'];
-                $query = Good::where('good.status', 2)
-                    ->where('good.website_id', $website);
-                switch ($Levelid) {
-                    case 1:
-                    case 2:
-                    case 3:
-                        $goods = $query->where(function ($q) use ($Levelid) {
-                            $q->whereRaw("JSON_CONTAINS(good.level, '" . intval($Levelid) . "') = 0")
-                                ->orWhereRaw("JSON_CONTAINS(good.level, '\"" . intval($Levelid) . "\"') = 0");
-                        });
-                        break;
-                    case 4:
-                        $goods = $query;
-                        break;
-                    case 5:
-                        $goods = $query->where('type_id', 1);
-                        break;
-                    case 6:
-                        $goods = $query->where('type_id', 2);
-                        break;
-                    default:
-                        return [];
-                }
-                $all_goods = $goods
-                    ->select(
-                        'good.id',
-                        'good.name',
-                        'good.imgurl',
-                        'good.description',
-                        'good.updated_at',
-                        'good.catid',
-                        'good.type_id',
-                        'good.price',
-                        'good.level',
-                        'good.website_id'
-                    )
-                    ->orderBy('updated_at', 'desc')
-                    ->offset($goodStart)
-                    ->limit($goodNum)
-                    ->get();
-                $web['website_id'] = $website;
-                $all_goods = $this->processGoods($all_goods, $web);
-            }
-            return  $all_goods;
-        }, $data);
-        $website = $input['website_id'];
-        $result['article'] = Article::where(function ($query) use ($website) {
-            $query->where(function ($subQuery) use ($website) {
-                $subQuery->whereRaw("JSON_CONTAINS(ignore_ids, '" . intval($website) . "') = 0");
-            })->orWhereNull("ignore_ids");
-        })
-            ->where('catid', $catid)
-            ->where('article.status', 1)
-            ->leftJoin('article_data', 'article_data.article_id', 'article.id')
-            ->select('article.id', 'article.title', 'article.updated_at', 'introduce', 'islink', 'linkurl', 'article_data.content')
+            if (isset($item['level']) && $item['level'] != 'undefined' && $item['level']!= "") { 
+                list($Levelid, $goodStart,$goodNum) = explode(',', $item['level']); 
+                $website = $input['website_id']; 
+                $query = Good::where('good.status', 2) 
+                    ->where('good.website_id', $website); 
+                switch ($Levelid) { 
+                    case 1: 
+                    case 2: 
+                    case 3: 
+                        $goods = $query->where(function($q) use ($Levelid) { 
+                            $q->whereRaw("JSON_CONTAINS(good.level, '". intval($Levelid). "') = 1") 
+                              ->orWhereRaw("JSON_CONTAINS(good.level, '\"". intval($Levelid). "\"') = 1"); 
+                        }); 
+                        break; 
+                    case 4: 
+                        $goods = $query; 
+                        break; 
+                    case 5: 
+                        $goods = $query->where('type_id',1); 
+                        break; 
+                    case 6: 
+                        $goods = $query->where('type_id',2); 
+                        break; 
+                    default: 
+                        return []; 
+                } 
+                $all_goods = $goods 
+                    ->select('good.id', 'good.name', 'good.imgurl', 'good.description', 
+                     'good.updated_at', 'good.catid','good.type_id','good.price','good.level', 
+                     'good.website_id') 
+                    ->orderBy('updated_at','desc') 
+                    ->offset($goodStart) 
+                    ->limit($goodNum) 
+                    ->get(); 
+                $web['website_id'] = $website; 
+                $all_goods = $this->processGoods($all_goods, $web); 
+            } 
+            return  $all_goods; 
+        }, $data); 
+        $website = $input['website_id']; 
+        $result['article'] = Article::where(function ($query) use ($website) { 
+                $query->where(function ($subQuery) use ($website) { 
+                    $subQuery->whereRaw("JSON_CONTAINS(ignore_ids, '" . intval($website) . "') = 0"); 
+                })->orWhereNull("ignore_ids"); 
+            }) 
+            ->where('catid', $catid) 
+            ->where('article.status', 1) 
+            ->leftJoin('article_data', 'article_data.article_id', 'article.id') 
+            ->select('article.id', 'article.title', 'article.updated_at', 'introduce', 'islink', 'linkurl','article_data.content')
             ->orderBy('article.updated_at', 'desc')
             ->first();
         return Result::success($result);
@@ -4568,7 +4559,7 @@ class NewsService implements NewsServiceInterface
         return Result::success($result);
     }
     /*
-    * 获取招聘信息列表
+    * 获取招聘信息列表-职场机会(个人会员收到企业推送岗位)
     * */
     public function getRecruitingList(array $data): array
     {
@@ -4576,10 +4567,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');
@@ -4665,6 +4657,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.