Procházet zdrojové kódy

c端-企业相关接口:获取模块企业;获取企业列表;获取企业详情;

15313670163 před 1 týdnem
rodič
revize
ec40115bf8

+ 65 - 24
app/JsonRpc/NewsService.php

@@ -61,8 +61,9 @@ use App\Model\Riddle;
 use App\Model\Idiom;
 use App\Model\WhiteRouter;
 use Illuminate\Support\Facades\Cache;
-use App\Model\Company;
 
+use App\Model\Company;
+use Hyperf\Paginator\Paginator;
 #[RpcService(name: "NewsService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
 class NewsService implements NewsServiceInterface
 {
@@ -6092,47 +6093,87 @@ class NewsService implements NewsServiceInterface
      */
     public function getWebsiteCompany(array $data): array
     {
-        $job = JobRecruiting::where('job_recruiting.website_id', $data['website_id'])
-            ->where('job_recruiting.status', 1)
-            ->where('job_recruiting.id', $data['id'])
-            ->leftJoin('job_company', 'job_recruiting.id', '=', 'job_company.job_id')
-            ->select('job_company.*')
-            ->first();
-        if(empty($job)){
+        $where['website_id'] = $data['website_id'];
+        $where['status'] = 1;
+        if(isset($data['category_id']) && !empty($data['category_id'])){
+           $where['category_id'] = $data['category_id'];
+        }
+        if(isset($data['level']) && !empty($data['level'])){
+            $where['level'] = $data['level'];
+        }
+        // return Result::success($where);
+        $query = Company::where($where);
+        $result['img'] = $this->processArticle(
+            $query->clone()
+            ->where('imgurl','!=', '')
+            ->whereNotNull('imgurl')
+            ->select('id','imgurl','title','introduce','description','content','category_id','cat_arr_id')
+            ->orderBy('updated_at', 'desc')
+            ->limit($data['imgnum'])
+            ->get(),
+            $data
+        );
+
+        $result['text'] =  $this->processArticle(
+            $query->clone()
+            ->select('id','title','introduce','description','content','category_id','cat_arr_id')
+            ->orderBy('updated_at', 'desc')
+            ->limit($data['textnum'])
+            ->get(),
+            $data
+        );
+        if(empty($result)){
             return Result::error("暂无相关公司信息", 0);
         }
-        return Result::success($job['company_id']);
+        return Result::success($result);
     }
     /**
      * @param array $data
      * @return array
      */
-    public function getWebsiteCompanyInfo(array $data): array
+    public function getWebsiteCompanyList(array $data): array
     {
-        $job = JobCompany::where('job_company.website_id', $data['website_id'])
-            ->where('job_company.status', 1)
-            ->where('job_company.id', $data['id'])
-            ->select('job_company.*')
-            ->first();
-        if(empty($job)){
+        $where['website_id'] = $data['website_id'];
+        $where['status'] = 1;
+        if(isset($data['category_id']) && !empty($data['category_id'])){
+           $where['category_id'] = $data['category_id'];
+        }
+        if(isset($data['keyword']) && !empty($data['keyword'])){
+            array_push($where, ['title', 'like', '%' . $data['keyword'] . '%']);
+        }
+        $query = Company::where($where);
+        $company = $this->processArticle(
+            $query->select('id','title','introduce','description','content','category_id','cat_arr_id')
+            ->orderBy('updated_at', 'desc')
+            ->offset(($data['page'] - 1) * $data['pageSize'])
+            ->limit($data['pageSize'])
+            ->get(),
+            $data
+        );
+        if(empty($company)){
             return Result::error("暂无相关公司信息", 0);
         }
-        return Result::success($job);
+        $result = [
+            'count' => $query->clone()->count(),
+            'data' => $company,
+        ];
+        return Result::success($result);
     }
     /**
      * @param array $data
      * @return array
      */
-    public function getWebsiteCompanyList(array $data): array
+    public function getWebsiteCompanyInfo(array $data): array
     {
-        $job = JobCompany::where('job_company.website_id', $data['website_id'])
-            ->where('job_company.status', 1)
-            ->select('job_company.*')
-            ->get();
-        if(empty($job)){
+        $company = Company::where('id', $data['id'])
+            ->where('status', 1)
+            ->where('website_id', $data['website_id'])
+            ->select('company.*')
+            ->first();
+        if(empty($company)){
             return Result::error("暂无相关公司信息", 0);
         }
-        return Result::success($job);
+        return Result::success($company);
     }
 
 

+ 0 - 27
app/Model/jobResume.php

@@ -1,27 +0,0 @@
-<?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 = [];
-}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
runtime/container/classes.cache


+ 1 - 1
runtime/hyperf.pid

@@ -1 +1 @@
-9286
+9286

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů