소스 검색

Merge branch '20250210_lj_zhanqun'

AI 1 개월 전
부모
커밋
be1435e309

+ 2 - 2
.env

@@ -2,11 +2,11 @@ APP_NAME=user_producer
 APP_ENV=dev
 
 DB_DRIVER=mysql
-DB_HOST=192.168.1.123
+DB_HOST=101.254.114.211
 DB_PORT=13306
 DB_DATABASE=hyperf
 DB_USERNAME=root
-DB_PASSWORD=zxt_mysql_dev
+DB_PASSWORD=xKmapDpKCxMMSkbe
 DB_CHARSET=utf8mb4
 DB_COLLATION=utf8mb4_unicode_ci
 DB_PREFIX=

+ 74 - 0
app/JsonRpc/NewsService.php

@@ -6,6 +6,7 @@ use App\Model\ArticleData;
 use App\Model\Category;
 use App\Model\WebsiteCategory;
 use App\Model\ArticleSurvey;
+use App\Model\jobHunting;
 use App\Model\Good;
 use App\Model\Website;
 use Hyperf\DbConnection\Db;
@@ -184,6 +185,7 @@ class NewsService implements NewsServiceInterface
         unset($data['user_id']);
 
         $where = [];
+        $status1 = [];
 
         if (isset($data['title']) && $data['title']) {
             array_push($where, ['article.title', 'like', '%' . $data['title'] . '%']);
@@ -200,6 +202,9 @@ class NewsService implements NewsServiceInterface
         if (isset($data['status']) && $data['status'] !== "") {
             array_push($where, ['article.status', '=', $data['status']]);
         }
+        if (isset($data['status1'])) {
+            $status1 = json_decode(($data['status1']));
+        }
         //不是管理员展示个人数据;
         if ($type_id != 10000) {
             $where[] = ['article.admin_user_id', '=', $user_id];
@@ -207,12 +212,22 @@ class NewsService implements NewsServiceInterface
 
         $rep = Article::where($where)
             ->whereNotIn('article.status', [404])
+            ->when($status1, function ($query) use ($status1) {
+                if (isset($status1) && $status1) {
+                    $query->whereIn('article.status', $status1);
+                }
+            })
             ->leftJoin('category', 'article.catid', 'category.id')
             ->select("article.*", "category.name as category_name")
             ->orderBy("article.id", "desc")
             ->limit($data['pageSize'])
             ->offset(($data['page'] - 1) * $data['pageSize'])->get();
         $count = Article::where($where)->whereNotIn('article.status', [404])
+            ->when($status1, function ($query) use ($status1) {
+                if (isset($status1) && $status1) {
+                    $query->whereIn('article.status', $status1);
+                }
+            })
             ->leftJoin('category', 'article.catid', 'category.id')->count();
         $data = [
             'rows' => $rep->toArray(),
@@ -1044,5 +1059,64 @@ class NewsService implements NewsServiceInterface
     }
 
     //20250226  产品列表
+    //20250306  求职信息
+    public function getJobHuntingList(array $data): array
+    {
+        $where = [];
+        if (isset($data['name']) && !empty($data['name'])) {
 
+            $where[] = ['name', 'like', '%' . $data['name'] . '%'];
+        }
+        $result = JobHunting::where($where)
+            ->leftJoin('user', 'user.id', '=', 'job_hunting.user_id')
+            ->leftJoin('website', 'website.id', '=', 'job_hunting.website_id')
+            ->select('job_hunting.*', 'user.nickname as nickname', 'user.user_name as username', 'website.website_name as website_name')
+            ->orderBy("updated_at", "desc")
+            ->limit($data['page_size'])
+            ->offset(($data['page'] - 1) * $data['page_size'])
+            ->get();
+        if (empty($result)) {
+            return Result::error("查询失败", 0);
+        }
+        $count = JobHunting::where($where)->count();
+        $data = [
+            'rows' => $result->toArray(),
+            'count' => $count,
+        ];
+        return Result::success($data);
+    }
+    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,8 +98,14 @@ 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  求职信息
 
      /**
      * @param array $data

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

+ 31 - 0
bin/hyperf.php

@@ -0,0 +1,31 @@
+#!/usr/bin/env php
+<?php
+/**
+ * This file is part of Hyperf.
+ *
+ * @link     https://www.hyperf.io
+ * @document https://hyperf.wiki
+ * @contact  group@hyperf.io
+ * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
+ */
+ini_set('display_errors', 'on');
+ini_set('display_startup_errors', 'on');
+ini_set('memory_limit', '1G');
+
+error_reporting(E_ALL);
+
+! defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1));
+
+require BASE_PATH . '/vendor/autoload.php';
+
+! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', Hyperf\Engine\DefaultOption::hookFlags());
+
+// Self-called anonymous function that creates its own scope and keep the global namespace clean.
+(function () {
+    Hyperf\Di\ClassLoader::init();
+    /** @var Psr\Container\ContainerInterface $container */
+    $container = require BASE_PATH . '/config/container.php';
+
+    $application = $container->get(Hyperf\Contract\ApplicationInterface::class);
+    $application->run();
+})();

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
runtime/container/classes.cache


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
runtime/container/scan.cache


+ 1 - 1
runtime/hyperf.pid

@@ -1 +1 @@
-39344
+48352

+ 0 - 1
vendor/composer/autoload_classmap.php

@@ -17,7 +17,6 @@ return array(
     'App\\Listener\\ResumeExitCoordinatorListener' => $baseDir . '/app/Listener/ResumeExitCoordinatorListener.php',
     'App\\Model\\Article' => $baseDir . '/app/Model/Article.php',
     'App\\Model\\ArticleData' => $baseDir . '/app/Model/ArticleData.php',
-    'App\\Model\\ArticleSurvey' => $baseDir . '/app/Model/ArticleSurvey.php',
     'App\\Model\\Category' => $baseDir . '/app/Model/Category.php',
     'App\\Model\\Link' => $baseDir . '/app/Model/Link.php',
     'App\\Model\\Model' => $baseDir . '/app/Model/Model.php',

+ 0 - 1
vendor/composer/autoload_static.php

@@ -701,7 +701,6 @@ class ComposerStaticInit88f2a4d4a4e81dc7d415bcdf39930654
         'App\\Listener\\ResumeExitCoordinatorListener' => __DIR__ . '/../..' . '/app/Listener/ResumeExitCoordinatorListener.php',
         'App\\Model\\Article' => __DIR__ . '/../..' . '/app/Model/Article.php',
         'App\\Model\\ArticleData' => __DIR__ . '/../..' . '/app/Model/ArticleData.php',
-        'App\\Model\\ArticleSurvey' => __DIR__ . '/../..' . '/app/Model/ArticleSurvey.php',
         'App\\Model\\Category' => __DIR__ . '/../..' . '/app/Model/Category.php',
         'App\\Model\\Link' => __DIR__ . '/../..' . '/app/Model/Link.php',
         'App\\Model\\Model' => __DIR__ . '/../..' . '/app/Model/Model.php',

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.