瀏覽代碼

建立获取招工招聘下拉框内容接口

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

+ 25 - 6
app/JsonRpc/NewsService.php

@@ -2664,6 +2664,30 @@ class NewsService implements NewsServiceInterface
             return $article;
         });
     }
+    /**
+     * c端-获取招工招聘下拉选框
+     * @param array $data
+     * @return array
+     *  */
+    public function getWebsiteJobSelect(array $data): array
+    {
+        $web = Website::where('id', $data['website_id'])->first();
+        if(empty($web)){
+            return Result::error("该网站不存在", 0);
+        }
+        $hy = JobIndustry::get()->all();
+        $zw = JobPosition::where('zwpid',0)->get()->all();
+        $jtzw = JobPosition::where('zwpid','!=',0)->get()->all();
+        $result = [
+            'hy' => $hy,
+            'zw' => $zw,
+            'jtzw' => $jtzw,
+        ];
+        if(empty($result)){
+            return Result::error("查询失败", 0);
+        }
+        return Result::success($result);
+    }
     /**
      * c端-获取招工招聘
      * @param array $data
@@ -2733,15 +2757,10 @@ class NewsService implements NewsServiceInterface
         } else {
             $job_recruitings = $this->processJob($job_recruiting, $web);
         }
-        $hy = JobIndustry::get()->all();
-        $zw = JobPosition::where('zwpid', 0)->get()->all();
-        $jtzw = JobPosition::where('zwpid', '!=', 0)->get()->all();
+       
         $result = [
             'job_hunting' => $job_huntings,
             'job_recuiting' => $job_recruitings,
-            'hy' => $hy,
-            'zw' => $zw,
-            'jtzw' => $jtzw,
         ];
         return Result::success($result);
     }

+ 5 - 0
app/JsonRpc/NewsServiceInterface.php

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