瀏覽代碼

建立获取推荐职位的接口

15313670163 1 周之前
父節點
當前提交
951ef648ce
共有 2 個文件被更改,包括 30 次插入1 次删除
  1. 25 1
      app/JsonRpc/NewsService.php
  2. 5 0
      app/JsonRpc/NewsServiceInterface.php

+ 25 - 1
app/JsonRpc/NewsService.php

@@ -2734,5 +2734,29 @@ private function fetchArticles($catId, $website, $limit, $isImageArticle = false
             return Result::success($pinyin);
         }
     }
-    
+    /**
+     * 招工招聘  -  获取推荐职位
+     * @param array $data
+     * @return array
+     */
+    public function getWebsiteLevelJob(array $data): array
+    {
+        // 状态   0:待审核;1:已审核通过;(只有企业会员需要审核);2:已拒绝;
+        $job = JobRecruiting::where('job_recruiting.website_id', $data['website_id'])
+            ->where('job_recruiting.status', 1)
+            ->where('job_level', $data['job_level'])
+            ->leftJoin('job_company', 'job_recruiting.id', '=', 'job_company.job_id')
+            ->select('job_recruiting.id','job_recruiting.title','job_recruiting.cat_arr_id','job_company.business_name','job_recruiting.updated_at')
+            ->orderBy('job_recruiting.updated_at', 'desc') 
+            ->limit($data['pageSize'])
+            ->get();
+        $web = ['website_id' => $data['website_id']];
+        if(!empty($job)){
+            $result = $this->processJob($job, $web);
+        }
+       if(empty($result)){
+            return Result::error("暂无相关职位信息", 0);
+       }
+        return Result::success($result);
+    }
 }

+ 5 - 0
app/JsonRpc/NewsServiceInterface.php

@@ -207,4 +207,9 @@ interface NewsServiceInterface
      * @return array
      */
     public function getWebsiteJobSelect(array $data):array;
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function getWebsiteLevelJob(array $data):array;
 }