AI 1 개월 전
부모
커밋
0989b62850
3개의 변경된 파일84개의 추가작업 그리고 2개의 파일을 삭제
  1. 50 1
      app/JsonRpc/NewsService.php
  2. 7 1
      app/JsonRpc/NewsServiceInterface.php
  3. 27 0
      app/Model/jobHunting.php

+ 50 - 1
app/JsonRpc/NewsService.php

@@ -7,6 +7,7 @@ use App\Model\Category;
 use App\Model\WebsiteCategory;
 use App\Model\ArticleSurvey;
 use App\Model\Good;
+use App\Model\JobHunting;
 
 use Hyperf\DbConnection\Db;
 use Hyperf\RpcServer\Annotation\RpcService;
@@ -454,7 +455,7 @@ class NewsService implements NewsServiceInterface
         } catch (\Throwable $ex) {
             Db::rollBack();
             var_dump($ex->getMessage());
-            return Result::error("更新失败1" . $ex->getMessage(), 0);
+            return Result::error("更新失败" . $ex->getMessage(), 0);
         }
     }
 
@@ -699,4 +700,52 @@ class NewsService implements NewsServiceInterface
     }
 
     //20250226  产品列表
+    //20250306  求职信息
+    public function getJobHuntingList(array $data): array
+    {
+        $where = [];
+        if (isset($data['title']) && !empty($data['title'])) {
+
+            $where[] = ['title', 'like', '%' . $data['title'] . '%'];
+        }
+        $result = JobHunting::where($where)->paginate($data['limit'], ['*'], 'page', $data['page'])->toArray();
+        if (empty($result)) {
+            return Result::error("查询失败", 0);
+        }
+        return Result::success($result);
+    }
+    public function addJobHunting(array $data): array
+    {
+        $data['created_at'] = date('Y-m-d H:i:s');
+        $data['updated_at'] = date('Y-m-d H:i:s');
+        $result = JobHunting::create($data);
+        if (empty($result)) {
+            return Result::error("添加失败", 0);
+        }
+        return Result::success($result);
+    }
+    public function delJobHunting(array $data): array
+    {
+        $result = JobHunting::where('id', $data['id'])->delete();
+        if (empty($result)) {
+            return Result::error("删除失败", 0);
+        }
+        return Result::success($result);
+    }
+    public function updateJobHunting(array $data): array
+    {
+        $result = JobHunting::where('id', $data['id'])->update($data);
+        if (empty($result)) {
+            return Result::error("更新失败", 0);
+        }
+        return Result::success($result);
+    }
+    public function getJobHuntingInfo(array $data): array
+    {
+        $result = JobHunting::where('id', $data['id'])->first();
+        if (empty($result)) {
+            return Result::error("查询失败", 0);
+        }
+        return Result::success($result);
+    }
 }

+ 7 - 1
app/JsonRpc/NewsServiceInterface.php

@@ -98,7 +98,13 @@ interface NewsServiceInterface
     public function addGood(array $data): array;
     public function delGood(array $data): array;
     public function updateGood(array $data): array;
-
     //20250226  产品列表
+    //20250306  求职信息
+    public function getJobHuntingList(array $data): array;
+    public function getJobHuntingInfo(array $data): array;
+    public function addJobHunting(array $data): array;
+    public function delJobHunting(array $data): array;
+    public function updateJobHunting(array $data): array;
+    //20250306  求职信息
 
 }

+ 27 - 0
app/Model/jobHunting.php

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