rkljw 1 kuukausi sitten
vanhempi
sitoutus
e5c4bfa809

+ 714 - 297
app/JsonRpc/NewsService.php

@@ -62,6 +62,8 @@ use App\Model\Idiom;
 use App\Model\WhiteRouter;
 use Illuminate\Support\Facades\Cache;
 
+use App\Model\Company;
+use Hyperf\Paginator\Paginator;
 #[RpcService(name: "NewsService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
 class NewsService implements NewsServiceInterface
 {
@@ -1458,175 +1460,6 @@ class NewsService implements NewsServiceInterface
    * @param array $data
    * @return array
    */
-  public function getWebsiteAllArticle(array $data): array
-  {
-
-
-
-    // $redisKey = 'website_cache';
-    // $this->redis->hSet($redisKey, $data['website_id'], json_encode($data));
-    // $result = $this->redis->sadd($redisKey);
-    // 使用缓存键
-    // $cacheKey = $data['website_id'];
-
-    //  // 尝试从缓存获取数据
-    $container = \Hyperf\Context\ApplicationContext::getContainer();
-    $cache = $container->get(\Psr\SimpleCache\CacheInterface::class);
-    // 修正传入的字符串,将单引号替换为双引号
-    $input['id'] = $data['id'];
-    $input['website_id'] = $data['website_id'];
-
-    // 将 JSON 字符串转换为 PHP 数组
-    $items = json_decode($input['id'], true);
-
-    if (!is_array($items)) {
-      return Result::error("无效的JSON格式", 0);
-    }
-
-    $website = [
-      'website_id' => $input['website_id'],
-    ];
-    foreach ($items as $key => $item) {
-      if (isset($item['parent']) && $item['parent'] !== "") {
-        $parentParams = explode(',', $item['parent']);
-        if (isset($parentParams) && $parentParams[0] !== "") {
-          $parentCatId[$key] = $parentParams[0];
-        }
-      } else {
-        return Result::error("缺少必需参数错误", 0);
-      }
-    }
-    $pid = WebsiteCategory::whereIn('category_id', $parentCatId)->where($website)->pluck('pid')->toArray();
-    // return Result::success($pid);
-    if (!empty($pid)) {
-      $pid = array_values(array_unique($pid));
-      if (count($pid) == 1) {
-        $cacheKey = $data['website_id'] . ',' . $pid[0];
-      } else {
-        return Result::error("参数传递错误", 0);
-      }
-    }
-    // return Result::success($cacheKey);
-    if ($cachedData = $cache->get($cacheKey)) {
-      return Result::success(unserialize($cachedData));
-    }
-    try {
-
-
-      // 提前缓存常用查询结果,减少重复查询
-      $categoryCache = [];
-      $childCategoryCache = [];
-
-      // 使用 array_map 处理每个元素
-      $result = array_map(function ($item) use ($website, &$categoryCache, &$childCategoryCache) {
-        $resultItem = [
-          'alias' => null,
-          'category_id' => null,
-          'pinyin' => null,
-          'imgnum' => [],
-          'textnum' => [],
-          'child' => []
-        ];
-
-        // 处理父级栏目
-        if (isset($item['parent']) && $item['parent'] !== 'undefined' && $item['parent'] !== "") {
-          $parentParams = explode(',', $item['parent']);
-
-          if (count($parentParams) !== 3) {
-            return Result::error("父级栏目:缺少必需参数错误", 0);
-          }
-
-          list($parentCatId, $parentImgNum, $parentTextNum) = $parentParams;
-          $cacheKey = "parent_{$parentCatId}_{$website['website_id']}";
-
-          if (!isset($categoryCache[$cacheKey])) {
-            // 查询栏目名称
-            $categoryCache[$cacheKey] = WebsiteCategory::where('category_id', $parentCatId)
-              ->where($website)
-              ->first(['alias', 'category_id', 'aLIas_pinyin', 'type']);
-          }
-
-          $category = $categoryCache[$cacheKey];
-
-          if (!empty($category)) {
-            $resultItem['alias'] = $category->alias;
-            $resultItem['category_id'] = $category->category_id;
-            $resultItem['pinyin'] = $category->aLIas_pinyin;
-
-            // 查询图片新闻
-            if (!empty($parentImgNum)) {
-              $resultItem['imgnum'] = $this->fetchArticles($parentCatId, $website, (int)$parentImgNum, true);
-            }
-
-            // 查询文字新闻
-            if (!empty($parentTextNum)) {
-              $resultItem['textnum'] = $this->fetchArticles($parentCatId, $website, (int)$parentTextNum, false);
-            }
-          }
-        }
-
-        // 处理子级栏目
-        if (isset($item['child']) && $item['child'] !== 'undefined' && $item['child'] !== "") {
-          $childParams = explode(',', $item['child']);
-
-          if (count($childParams) !== 3) {
-            return Result::error("子级栏目:缺少必需参数错误", 0);
-          }
-
-          list($childCatId, $childImgNum, $childTextNum) = $childParams;
-          $cacheKey = "child_{$childCatId}_{$website['website_id']}";
-
-          if (!isset($childCategoryCache[$cacheKey])) {
-            // 查询子栏目信息
-            $childCategoryCache[$cacheKey] = WebsiteCategory::where($website)
-              ->where("category_id", $childCatId)
-              ->whereRaw("JSON_CONTAINS(category_arr_id, '" . intval($childCatId) . "') = 1")
-              ->first(['alias', 'category_id', 'aLIas_pinyin', 'pid', 'category_arr_id as cat_arr_id']);
-          }
-
-          $childCategory = $childCategoryCache[$cacheKey];
-
-          if (!empty($childCategory)) {
-            $childCategory = $this->processArticles($childCategory, $website);
-
-            // 查询此层级的所有子栏目
-            $allChildCategories = WebsiteCategory::where($website)
-              ->where("pid", $childCategory['pid'])
-              ->get(['alias', 'category_id', 'aLIas_pinyin', 'pid', 'category_arr_id as cat_arr_id']);
-
-            $allChildCategories = $this->processArticles($allChildCategories, $website);
-
-            $childResult = [
-              'alias' => $childCategory->alias,
-              'category_id' => $childCategory->category_id,
-              'pinyin' => $childCategory->aLIas_pinyin,
-              'all_childcat' => $allChildCategories,
-              'imgnum' => [],
-              'textnum' => []
-            ];
-
-            // 查询子栏目图片新闻
-            if (!empty($childImgNum)) {
-              $childResult['imgnum'] = $this->fetchArticles($childCatId, $website, (int)$childImgNum, true);
-            }
-
-            // 查询子栏目文字新闻
-            if (!empty($childTextNum)) {
-              $childResult['textnum'] = $this->fetchArticles($childCatId, $website, (int)$childTextNum, false);
-            }
-
-            $resultItem['child'] = $childResult;
-          }
-        }
-        return $resultItem;
-      }, $items);
-      $cache->set($cacheKey, serialize($result), 86400);
-      return Result::success($result);
-    } catch (\Exception $e) {
-      // 记录错误日志
-      return Result::error("获取网站文章失败: " . $e->getMessage());
-    }
-  }
 
   /**
    * 辅助方法:获取文章列表
@@ -2034,77 +1867,77 @@ class NewsService implements NewsServiceInterface
      * @param array $data
      * @return array
      *  */
-  public function getWebsiteshopList(array $data): array
-  {
-    // return Result::success($data);
-    $where = [
-      'status' => 2,
-      'website_id' => $data['website_id'],
-    ];
-    if ((empty($data['catid']) || !isset($data['catid'])) && (empty($data['keyword']) || !isset($data['keyword'])) && (empty($data['city_id']) || !isset($data['city_id']))) {
-      return Result::error("查询失败", 0);
-    }
-    if ((empty($data['catid']) || !isset($data['catid'])) && (!empty($data['city_id']) || isset($data['city_id']))) {
-      $category = WebsiteCategory::where('website_id', $data['website_id'])->where('pid', $data['id'])->orderBy('sort')->first(['category_id']);
-      $data['catid'] = $category->category_id ??  0;
-    }
-    if (isset($data['keyword']) && !empty($data['keyword'])) {
-      array_push($where, ['name', 'like', '%' . $data['keyword'] . '%']);
-    }
-    if (isset($data['type_id']) && !empty($data['type_id'])) {
-      array_push($where, ['type_id', $data['type_id']]);
-    }
-    $query = Good::where($where)
-      ->when(isset($data['catid']) && !empty($data['catid']), function ($query) use ($data) {
-        $query->where(function ($q) use ($data) {
-          $q->WhereRaw("JSON_CONTAINS(good.cat_arr_id, '" . intval($data['catid']) . "') = 1")
-            ->orWhereRaw("JSON_CONTAINS(good.cat_arr_id, '\"" . intval($data['catid']) . "\"') = 1");
-        });
-      })
-      ->when(isset($data['city_id']) && !empty($data['city_id']), function ($query) use ($data) {
-        $query->where(function ($q) use ($data) {
-          $q->WhereRaw("JSON_CONTAINS(good.city_arr_id, '" . intval($data['city_id']) . "') = 1")
-            ->orWhereRaw("JSON_CONTAINS(good.city_arr_id, '\"" . intval($data['city_id']) . "\"') = 1");
-        });
-      })
-      ->select(
-        'good.id',
-        'good.name',
-        'good.imgurl',
-        'good.description',
-        'good.updated_at',
-        'good.com',
-        'good.catid',
-        'good.type_id',
-        'good.website_id',
-        'good.cat_arr_id',
-        'good.created_at',
-        'good.city_id'
-      )
-      ->latest('updated_at');
-    $result['type1_count'] = $query->clone()->where('type_id', 1)->count();
-    // 获取 type_id 为 1 的数据
-    $result['type1'] = $this->processGoods(
-      $query->clone()
-        ->where('type_id', 1)
-        ->offset(($data['page'] - 1) * $data['pageSize'])
-        ->limit($data['pageSize'])
-        ->get(),
-      $data
-    );
-    $result['type2_count'] = $query->clone()->where('type_id', 2)->count();
-    // 获取 type_id 为 2 的数据
-    $result['type2'] = $this->processGoods(
-      $query->clone()
-        ->where('type_id', 2)
-        ->offset(($data['page'] - 1) * $data['pageSize'])
-        ->limit($data['pageSize'])
-        ->get(),
-      $data
-    );
-    if (empty($result)) {
-      return Result::error("查询失败", 0);
-    }
+    public function getWebsiteshopList(array $data): array
+    {
+        // return Result::success($data);
+        $where = [
+            'status' => 2,
+            'website_id' => $data['website_id'],
+        ];
+        if((empty($data['catid']) ||!isset($data['catid'])) && (empty($data['keyword']) ||!isset($data['keyword'])) && (empty($data['city_id']) || !isset($data['city_id']))){
+            return Result::error("查询失败", 0);
+        }
+        if ((empty($data['catid']) || !isset($data['catid'])) && (!empty($data['city_id']) || isset($data['city_id']))) {
+            $category = WebsiteCategory::where('website_id', $data['website_id'])->where('pid',$data['id'])->orderBy('sort')->first(['category_id']);
+            $data['catid'] = $category->category_id ??  0;
+        }
+        if(isset($data['keyword']) &&!empty($data['keyword'])){
+           array_push($where, ['name', 'like', '%'. $data['keyword'].'%']);
+        }
+        if(isset($data['type_id']) && !empty($data['type_id'])){
+            array_push($where, ['type_id', $data['type_id']]);
+        }
+        $query = Good::where($where)
+            ->when(isset($data['catid']) &&!empty($data['catid']), function ($query) use ($data) {
+                $query->where(function($q) use ($data) {
+                    $q->WhereRaw("JSON_CONTAINS(good.cat_arr_id, '". intval($data['catid']). "') = 1")
+                    ->orWhereRaw("JSON_CONTAINS(good.cat_arr_id, '\"". intval($data['catid']). "\"') = 1");
+                });
+            })
+            ->when(isset($data['city_id']) && !empty($data['city_id']), function ($query) use ($data) {
+                $query->where(function($q) use ($data) {
+                    $q->WhereRaw("JSON_CONTAINS(good.city_arr_id, '". intval($data['city_id']). "') = 1")
+                        ->orWhereRaw("JSON_CONTAINS(good.city_arr_id, '\"". intval($data['city_id']). "\"') = 1");
+                });
+            })
+            ->select('good.id', 'good.name', 'good.imgurl', 'good.description', 'good.updated_at', 'good.com',
+            'good.catid','good.type_id','good.website_id','good.cat_arr_id','good.created_at','good.city_id')
+            ->latest('updated_at');
+            if(isset($data['ismix']) && $data['ismix'] == 1){
+                $result['count'] = $query->clone()->count();
+                $result['goods'] = $this->processGoods(
+                    $query->clone()
+                        ->offset(($data['page'] - 1) * $data['pageSize'])
+                        ->limit($data['pageSize'])
+                        ->get(),
+                    $data
+                );
+            }else{
+                $result['type1_count'] = $query->clone()->where('type_id', 1)->count();
+                // 获取 type_id 为 1 的数据
+                $result['type1'] = $this->processGoods(
+                    $query->clone()
+                        ->where('type_id', 1)
+                        ->offset(($data['page'] - 1) * $data['pageSize'])
+                        ->limit($data['pageSize'])
+                        ->get(),
+                    $data
+                );
+                $result['type2_count'] = $query->clone()->where('type_id', 2)->count();
+                // 获取 type_id 为 2 的数据
+                $result['type2'] = $this->processGoods(
+                    $query->clone()
+                        ->where('type_id', 2)
+                        ->offset(($data['page'] - 1) * $data['pageSize'])
+                        ->limit($data['pageSize'])
+                        ->get(),
+                    $data
+                );
+            }
+            
+        if(empty($result)){
+            return Result::error("查询失败", 0); 
+        }
 
     return Result::success($result);
   }
@@ -2795,6 +2628,9 @@ class NewsService implements NewsServiceInterface
       if (isset($data['hy_id']) && !empty($data['hy_id'])) {
         array_push($recruit_where, ['hy_id', $data['hy_id']]);
       }
+      if(isset($data['keyword']) && !empty($data['keyword'])){ 
+        array_push($recruit_where, ['title','like','%'.$data['keyword'].'%']); 
+    } 
       $query = JobRecruiting::where('job_recruiting.status', 1)
         ->where('job_recruiting.website_id', $data['website_id'])
         ->where($recruit_where)
@@ -2849,6 +2685,9 @@ class NewsService implements NewsServiceInterface
       $query = JobHunting::where('status', 2)
         ->where('job_hunting.website_id', $data['website_id'])
         ->where($hunt_where)
+        ->when(isset($data['keyword']) &&!empty($data['keyword']), function ($query) use ($data) { 
+          $query->where('job_position.zwname','like','%'.$data['keyword'].'%'); 
+        }) 
         ->when(isset($data['city_id']) && !empty($data['city_id']), function ($query) use ($data) {
           $query->where(function ($q) use ($data) {
             $q->WhereRaw("JSON_CONTAINS(job_hunting.city_arr_id, '" . intval($data['city_id']) . "') = 1");
@@ -3464,10 +3303,38 @@ class NewsService implements NewsServiceInterface
     $data['city_arr_id'] = isset($data['city_arr_id']) ? json_encode($data['city_arr_id']) : '';
     $data['cat_arr_id'] = isset($data['cat_arr_id']) ? json_encode($data['cat_arr_id']) : '';
     $data['imgurl'] = isset($data['imgurl']) ? json_encode($data['imgurl']) : '';
-    unset($data['imgUrl']);
+    unset($data['imgUrl']); //大小写
     if (isset($data['price']) && $data['price'] == '') {
       $data['price'] =  0;
     }
+
+    if ($data['imgurl'] == '') {
+      $reg = '/<img.*?src=[\"|\']?(.*?)[\"|\']?\s.*?>/i';
+      preg_match_all($reg, $data['detail'], $matches);
+      if (isset($matches[1][0])) {
+        //截取varchar240
+        $data['imgurl'] = substr($matches[1][0], 0, 240);
+      }
+    }
+    if ($data['keyword'] == '' ||  $data['keyword'] == array()) {
+      //提取标题+内容中的关键词
+      $data['keyword'] = $data['name'];
+      //  . substr(str_replace(' ', '', strip_tags($data['content'])), 0, 20);
+      Jieba::init(); // 初始化 jieba-php
+      Finalseg::init();
+      $segList = Jieba::cut($data['keyword']);
+      $segList1 = array_slice($segList, 0, 8);
+      $data['keyword'] = implode(',', $segList1);
+    }
+    if ($data['description'] == '') {
+      //提取内容中的描述
+      $cleaned = preg_replace('/\s+/', '', strip_tags(html_entity_decode($data['detail'], ENT_QUOTES, 'UTF-8')));
+      $data['description'] = mb_substr($cleaned, 0, 100, 'UTF-8');
+      // $data['description'] = substr(preg_replace('/\s+/', '', strip_tags($data['detail'])), 0, 100);
+    }
+
+
+
     $result = Good::insert($data);
     if (empty($result)) {
       return Result::error("添加失败", 0);
@@ -3487,6 +3354,33 @@ class NewsService implements NewsServiceInterface
     if (isset($data['price']) && $data['price'] == '') {
       $data['price'] =  0;
     }
+
+
+    if ($data['imgurl'] == '') {
+      $reg = '/<img.*?src=[\"|\']?(.*?)[\"|\']?\s.*?>/i';
+      preg_match_all($reg, $data['detail'], $matches);
+      if (isset($matches[1][0])) {
+        //截取varchar240
+        $data['imgurl'] = substr($matches[1][0], 0, 240);
+      }
+    }
+    if ($data['keyword'] == '' ||  $data['keyword'] == array()) {
+      //提取标题+内容中的关键词
+      $data['keyword'] = $data['name'];
+      //  . substr(str_replace(' ', '', strip_tags($data['content'])), 0, 20);
+      Jieba::init(); // 初始化 jieba-php
+      Finalseg::init();
+      $segList = Jieba::cut($data['keyword']);
+      $segList1 = array_slice($segList, 0, 8);
+      $data['keyword'] = implode(',', $segList1);
+    }
+    if ($data['description'] == '') {
+      //提取内容中的描述
+      $cleaned = preg_replace('/\s+/', '', strip_tags(html_entity_decode($data['detail'], ENT_QUOTES, 'UTF-8')));
+      $data['description'] = mb_substr($cleaned, 0, 100, 'UTF-8');
+    }
+
+
     $result = Good::where('id', $data['id'])->update($data);
     if (empty($result)) {
       return Result::error("更新失败", 0);
@@ -5244,7 +5138,8 @@ class NewsService implements NewsServiceInterface
     }
     if ($data['description'] == '') {
       //提取内容中的描述
-      $data['description'] = substr(preg_replace('/\s+/', '', strip_tags($data['detail'])), 0, 100);
+      $cleaned = preg_replace('/\s+/', '', strip_tags(html_entity_decode($data['detail'], ENT_QUOTES, 'UTF-8')));
+      $data['description'] = mb_substr($cleaned, 0, 100, 'UTF-8');
     }
     var_dump($data, '--');
 
@@ -5335,7 +5230,8 @@ class NewsService implements NewsServiceInterface
     }
     if ($data['description'] == '') {
       //提取内容中的描述
-      $data['description'] = substr(preg_replace('/\s+/', '', strip_tags($data['detail'])), 0, 100);
+      $cleaned = preg_replace('/\s+/', '', strip_tags(html_entity_decode($data['detail'], ENT_QUOTES, 'UTF-8')));
+      $data['description'] = mb_substr($cleaned, 0, 100, 'UTF-8');
     }
     $data['city_arr_id'] = is_array($data['city_arr_id']) ? Json::encode($data['city_arr_id']) : '[]';
     $data['cat_arr_id'] = is_array($data['cat_arr_id']) ? Json::encode($data['cat_arr_id']) : '[]';
@@ -5704,63 +5600,584 @@ class NewsService implements NewsServiceInterface
   /**
    * 农网导航首页数据
    */
-    public function getWebsiteNwHomeList(array $data): array{
-        $categoryIds =  WebsiteCategory::where(['website_id'=> $data['website_id']])->where("pid","!=",0)
-            ->pluck('category_id')
-            ->toArray();
-        // 使用子查询优化
-        $articlesList = DB::table('article')
-            ->select([
+  public function getWebsiteNwHomeList(array $data): array
+  {
+    $categoryIds =  WebsiteCategory::where(['website_id' => $data['website_id']])->where("pid", "!=", 0)
+      ->pluck('category_id')
+      ->toArray();
+    // 使用子查询优化
+    $articlesList = DB::table('article')
+      ->select([
+        'article.id',
+        'article.title',
+        'article.imgurl',
+        'article.created_at',
+        'category.name as category_name',
+        'category.id as category_id',
+        'website_category.aLIas_pinyin as pinyin',
+        'parent_wc.aLIas_pinyin as parent_pinyin',
+        DB::raw('100 as type')
+      ])
+      ->join('category', 'article.catid', '=', 'category.id')
+      ->leftJoin('website_category', 'website_category.category_id', '=', 'category.id')
+      ->leftJoin('website_category as parent_wc', function ($join) {
+        $join->on('parent_wc.category_id', '=', 'website_category.pid')
+          ->where('parent_wc.website_id', '=', DB::raw('website_category.website_id'));
+      })
+      ->where('website_category.website_id', $data['website_id'])
+      ->where('article.status', 1)
+      ->whereIn('category.id', $categoryIds)
+      ->orderBy('article.created_at', 'desc')
+      ->get()
+      ->groupBy('category_id')
+      ->map(function ($group) {
+        // 确保第一条数据有图片
+        $firstWithImage = $group->first(function ($item) {
+          return !empty($item->imgurl);
+        });
+
+        if ($firstWithImage) {
+          // 如果有带图片的文章,将其放在第一位
+          $group = $group->filter(function ($item) use ($firstWithImage) {
+            return $item->id !== $firstWithImage->id;
+          })->prepend($firstWithImage);
+        }
+
+        return [
+          'category_name' => $group->first()->category_name,
+          'catid' => $group->first()->category_id,
+          'pinyin' => $group->first()->pinyin,
+          'parent_pinyin' => $group->first()->parent_pinyin,
+          'list' => $group->take(4)->map(function ($item) {
+            return [
+              'id' => $item->id,
+              'title' => $item->title,
+            ];
+          })->values()
+        ];
+      })
+      ->values()
+      ->toArray();
+    return Result::success($articlesList);
+  }
+
+  /**
+   * 模块新闻加强版 
+   * @param array $data
+   * @return array
+   */
+  public function getWebsiteAllArticle(array $data): array
+  {
+
+
+
+    // 修正传入的字符串,将单引号替换为双引号
+    $input['id'] = $data['id'];
+    $input['website_id'] = $data['website_id'];
+    // 将 JSON 字符串转换为 PHP 数组
+    $data = json_decode($input['id'], true);
+    // 使用 array_map 处理每个元素
+    $result = array_map(function ($item) use ($input) {
+      // 检查parent元素是否存在且不是undefined
+      if (isset($item['parent']) && $item['parent'] != 'undefined' && $item['parent'] != "") {
+        $count = explode(',', $item['parent']);
+        if (count($count) != 3) {
+          return Result::error("参数错误", 0);
+        }
+        list($parentCatId, $parentImgNum, $parentTextNum) = explode(',', $item['parent']);
+        $website = [
+          'website_id' => $input['website_id'],
+        ];
+        // 查询栏目名称
+        $categroy = WebsiteCategory::where('category_id', $parentCatId)->where($website)->first(['alias', 'category_id', 'aLIas_pinyin', 'type']);
+        // 查询图片新闻
+        if (isset($parentImgNum) && $parentImgNum != 0 && !empty($categroy)) {
+          $imgArticles = Article::where('article.status', 1)
+            ->where(function ($query) use ($parentCatId) {
+              $query->whereRaw("JSON_CONTAINS(cat_arr_id, '\"$parentCatId\"')")
+                ->orWhereRaw("JSON_CONTAINS(cat_arr_id, '$parentCatId')");
+            })
+            ->where(function ($query) use ($website) {
+              $query->where(function ($subQuery) use ($website) {
+                $subQuery->whereRaw("JSON_CONTAINS(ignore_ids, '" . intval($website['website_id']) . "') = 1")
+                  ->orWhereNull("ignore_ids");
+              });
+            })
+            ->where('imgurl', '!=', '')
+            ->leftJoin('website_category', function ($join) use ($website) {
+              $join->on('article.catid', '=', 'website_category.category_id')
+                ->where('website_category.website_id', '=', $website['website_id']);
+            })
+            ->select(
+              'article.id',
+              'article.title',
+              'article.imgurl',
+              'article.author',
+              'article.updated_at',
+              'article.introduce',
+              'article.islink',
+              'article.linkurl',
+              'article.copyfrom',
+              'article.cat_arr_id',
+              'article.catid',
+              'website_category.alias as category_name',
+            )
+            ->orderBy('updated_at', 'desc')
+            ->limit($parentImgNum)
+            ->get();
+          //调取封装路由的方法,处理新闻路由   
+          if (!empty($imgArticles)) {
+            $imgArticles = $this->processArticles($imgArticles, $website);
+          }
+        }
+        // 查询文字新闻
+        if (isset($parentTextNum) && $parentTextNum != 0 && !empty($categroy)) {
+          $textArticles = [];
+          $textArticles = Article::where('article.status', 1)
+            ->where(function ($query) use ($parentCatId) {
+              $query->whereRaw("JSON_CONTAINS(cat_arr_id, '\"$parentCatId\"')")
+                ->orWhereRaw("JSON_CONTAINS(cat_arr_id, '$parentCatId')");
+            })
+            ->where(function ($query) use ($website) {
+              $query->where(function ($subQuery) use ($website) {
+                $subQuery->whereRaw("JSON_CONTAINS(ignore_ids, '" . intval($website['website_id']) . "') = 1")
+                  ->orWhereNull("ignore_ids");
+              });
+            })
+            ->leftJoin('website_category', function ($join) use ($website) {
+              $join->on('article.catid', '=', 'website_category.category_id')
+                ->where('website_category.website_id', '=', $website['website_id']);
+            })
+            ->select(
+              'article.id',
+              'article.title',
+              'article.author',
+              'article.updated_at',
+              'article.cat_arr_id',
+              'article.introduce',
+              'article.islink',
+              'article.linkurl',
+              'article.copyfrom',
+              'article.catid',
+              'website_category.alias as category_name',
+            )
+            ->orderBy('updated_at', 'desc')
+            ->limit($parentTextNum)
+            ->get();
+          if (!empty($textArticles)) {
+            $textArticles = $this->processArticles($textArticles, $website);
+          }
+        }
+      }
+      $resultItem = [
+        'alias' =>  $categroy ? $categroy->alias : null,
+        'category_id' =>  $categroy ? $categroy->category_id : null,
+        'pinyin' =>  $categroy ? $categroy->aLIas_pinyin : null,
+        'imgnum' => $imgArticles ?? [],
+        'textnum' => $textArticles ?? [],
+      ];
+      if (isset($item['child']) && $item['child'] != 'undefined' && $item['child'] != "") {
+        list($childCatId, $childImgNum, $childTextNum) = explode(',', $item['child']);
+        $childCategory = WebsiteCategory::where($website)
+          ->where("category_id", $childCatId)
+          ->whereRaw("JSON_CONTAINS(category_arr_id, '" . intval($parentCatId) . "') = 1")
+          ->first(['alias', 'category_id', 'aLIas_pinyin', 'pid', 'type', 'category_arr_id as cat_arr_id']);
+        if (!empty($childCategory)) {
+          $childCategory = $this->processArticles($childCategory, $website);
+          // 查询此层级的所有子栏目
+          $all_childcat = WebsiteCategory::where($website)
+            ->where("pid", $childCategory['pid'])
+            ->whereRaw("JSON_CONTAINS(category_arr_id, '" . intval($parentCatId) . "') = 1")
+            ->get(['alias', 'category_id', 'aLIas_pinyin', 'pid', 'type', 'category_arr_id as cat_arr_id']);
+          $all_childcat = $this->processArticles($all_childcat, $website);
+          // 查询子栏目图片新闻
+          if (isset($childImgNum) && $childImgNum != 0) {
+            $childImgArticles = Article::where('catid', $childCatId)
+              ->where('status', 1)
+              ->where(function ($query) use ($website) {
+                $query->where(function ($subQuery) use ($website) {
+                  $subQuery->whereRaw("JSON_CONTAINS(ignore_ids, '" . intval($website['website_id']) . "') = 1");
+                })->orWhereNull("ignore_ids");
+              })
+              ->select(
                 'article.id',
                 'article.title',
                 'article.imgurl',
-                'article.created_at',
-                'category.name as category_name',
-                'category.id as category_id',
-                'website_category.aLIas_pinyin as pinyin',
-                'parent_wc.aLIas_pinyin as parent_pinyin',
-                DB::raw('100 as type')
-            ])
-            ->join('category', 'article.catid', '=', 'category.id')
-            ->leftJoin('website_category', 'website_category.category_id', '=', 'category.id')
-            ->leftJoin('website_category as parent_wc', function($join) {
-                $join->on('parent_wc.category_id', '=', 'website_category.pid')
-                    ->where('parent_wc.website_id', '=', DB::raw('website_category.website_id'));
-            })
-            ->where('website_category.website_id', $data['website_id'])
-            ->where('article.status', 1)
-            ->whereIn('category.id', $categoryIds)
-            ->orderBy('article.created_at', 'desc')
-            ->get()
-            ->groupBy('category_id')
-            ->map(function ($group) {
-                // 确保第一条数据有图片
-                $firstWithImage = $group->first(function ($item) {
-                    return !empty($item->imgurl);
-                });
+                'article.author',
+                'article.updated_at',
+                'article.introduce',
+                'article.islink',
+                'article.linkurl',
+                'article.catid',
+                'article.cat_arr_id',
+                'article.copyfrom',
+              )
+              ->where('imgurl', '!=', '')
+              ->orderBy('updated_at', 'desc')
+              ->limit($childImgNum)
+              ->get();
+            $childImgArticles = $this->processArticles($childImgArticles, $website);
+          }
+          // 查询子栏目文字新闻
+          if (isset($childTextNum) && $childTextNum != 0) {
+            $childTextArticles = Article::where('catid', $childCatId)
+              ->where('status', 1)
+              ->where(function ($query) use ($website) {
+                $query->where(function ($subQuery) use ($website) {
+                  $subQuery->whereRaw("JSON_CONTAINS(ignore_ids, '" . intval($website['website_id']) . "') = 1");
+                })->orWhereNull("ignore_ids");
+              })
+              ->select(
+                'article.id',
+                'article.title',
+                'article.author',
+                'article.updated_at',
+                'article.introduce',
+                'article.islink',
+                'article.linkurl',
+                'article.catid',
+                'article.cat_arr_id',
+                'article.copyfrom',
+              )
+              ->orderBy('updated_at', 'desc')
+              ->limit($childTextNum)
+              ->get();
+            $childTextArticles = $this->processArticles($childTextArticles, $website);
+          }
+        }
+        $resultItem['child'] = [
+          'alias' => $childCategory ? $childCategory->alias : null,
+          'category_id' => $childCategory ? $childCategory->category_id : null,
+          'type' => $childCategory ? $childCategory->type : null,
+          'pinyin' => $childCategory ? $childCategory->pinyin : null,
+          'all_childcat' => $all_childcat ?? [],
+          'imgnum' => $childImgArticles ?? [],
+          'textnum' => $childTextArticles ?? [],
+        ];
+      } else {
+        $resultItem['child'] = [];
+      }
+      return $resultItem;
+    }, $data);
+    return Result::success($result);
+  }
+  /**
+     * 企业管理
+     * @param array $data
+     * @return array
+     */
+    public function getCompanyList(array $data): array
+    {
+      // return Result::success($data);
+        $where = [];
+        $user = User::where('id', $data['user_id'])->first();
+        if(empty($user)){
+            return Result::error('用户不存在!');
+        }
+        if($user['type_id']!= 10000){
+            $where['user_id'] = $data['user_id'];
+        }
+        if(isset($data['title']) && !empty($data['title'])){
+            array_push($where, ['company.title', 'like', '%'. $data['title']. '%']);
+        }
+        if(isset($data['website_name']) && !empty($data['website_name'])){
+          array_push($where, ['website.website_name', 'like', '%'. $data['website_name']. '%']);
+        }
+        if(isset($data['ischeck']) && !empty($data['ischeck'])){
+          if($data['ischeck'] == 1){
+              if(isset($data['status']) && $data['status'] != ''){
+                array_push($where, ['company.status', $data['status']]);
+                $query = Company::where($where);
+              }else{
+                $query =  Company::whereIn('company.status', [0,2]);
+              }
+          }else{
+              $query =  Company::where('company.status', 1);
+          }
+        }
+        $result = $query->where($where)
+        ->leftJoin('website_category', function ($query) {
+            $query->on('website_category.category_id', '=', 'company.category_id')
+                ->on('website_category.website_id', '=', 'company.website_id');        
+        })
+        ->leftJoin('website', 'company.website_id', '=', 'website.id')
+        ->select(
+          'company.id', 
+          'company.title', 
+          'company.website_id', 
+          'company.category_id', 
+          'website.website_name', 
+          'website_category.alias as category_name',
+          'company.status',
+          'company.updated_at',
+        )
+        ->orderBy('company.updated_at', 'desc')
+        ->paginate($data['pageSize'], ['*'], 'page', $data['page']);
 
-                if ($firstWithImage) {
-                    // 如果有带图片的文章,将其放在第一位
-                    $group = $group->filter(function ($item) use ($firstWithImage) {
-                        return $item->id !== $firstWithImage->id;
-                    })->prepend($firstWithImage);
-                }
-
-                return [
-                    'category_name' => $group->first()->category_name,
-                    'catid' => $group->first()->category_id,
-                    'pinyin' => $group->first()->pinyin,
-                    'parent_pinyin' => $group->first()->parent_pinyin,
-                    'list' => $group->take(4)->map(function ($item) {
-                        return [
-                            'id' => $item->id,
-                            'title' => $item->title,
-                        ];
-                    })->values()
-                ];
-            })
-            ->values()
-            ->toArray();
-        return Result::success($articlesList);
+      if($result->isEmpty()){
+          return Result::error("暂无企业", 0);
+      }
+        return Result::success($result);
+    }
+    /**
+     * 添加企业
+     * @param array $data
+     * @return array
+     */
+    public function addCompany(array $data): array
+    {
+        $data['category_id'] = isset($data['cat_arr_id']) ? end($data['cat_arr_id']) : '';
+        if(isset($data['cat_arr_id']) &&!empty($data['cat_arr_id']) && is_array($data['cat_arr_id'])){
+          $car_arr_id = array_values(array_unique(array_map('intval', $data['cat_arr_id'])));
+          $data['cat_arr_id'] = json_encode($car_arr_id);
+        }else{
+            $data['cat_arr_id'] = '';
+        }
+        if ($data['imgurl'] == '') {
+            //content中提取图片第一个图,正则提取
+            $reg = '/<img.*?src=[\"|\']?(.*?)[\"|\']?\s.*?>/i';
+            preg_match_all($reg, $data['content'], $matches);
+            if (isset($matches[1][0])) {
+                //截取varchar240
+                $data['imgurl'] = substr($matches[1][0], 0, 240);
+            } 
+        }
+        if ($data['keyword'] == '') {
+            //提取标题+内容中的关键词
+            $data['keyword'] = $data['title'];
+            //  . substr(str_replace(' ', '', strip_tags($data['content'])), 0, 20);
+            Jieba::init(); // 初始化 jieba-php
+            Finalseg::init();
+            $segList = Jieba::cut($data['keyword']);
+            $segList1 = array_slice($segList, 0, 8);
+            $data['keyword'] = implode(',', $segList1);
+        }
+        if ($data['introduce'] == '' || empty($data['introduce'])) {
+            //提取内容中的描述
+            $data['introduce'] = mb_substr(str_replace(' ', '', strip_tags($data['content'])), 0, 100) ?? '';
+        }
+        $user = User::where('id', $data['user_id'])->first();
+        if(empty($user)){
+            return Result::error('用户不存在!');
+        }
+        if($user['type_id']== 10000){
+            $data['status'] = 1;
+        }
+        if(isset($data['level']) && $data['level'] != null){
+          $data['level'] = intval($data['level']);
+      }else{
+          $data['level'] = null;
+      }
+        $result = Company::insertGetId($data);
+        if ($result) {
+            return Result::success($result);
+        } else {
+            return Result::error('添加失败');
+        }
+    }
+    /**
+     * 更新企业
+     * @param array $data
+     * @return array
+     */
+    public function upCompany(array $data): array
+    {
+        if(isset($data['cat_arr_id']) &&!empty($data['cat_arr_id']) && is_array($data['cat_arr_id'])){
+            $car_arr_id = array_values(array_unique(array_map('intval', $data['cat_arr_id'])));
+            $data['cat_arr_id'] = json_encode($car_arr_id);
+            $data['category_id'] = isset($data['cat_arr_id']) ? end($car_arr_id) : '';
+        }else{
+            $data['cat_arr_id'] = '';
+        }
+        if ($data['imgurl'] == '') {
+            //content中提取图片第一个图,正则提取
+            $reg = '/<img.*?src=[\"|\']?(.*?)[\"|\']?\s.*?>/i';
+            preg_match_all($reg, $data['content'], $matches);
+            if (isset($matches[1][0])) {
+                //截取varchar
+                $data['imgurl'] = substr($matches[1][0], 0, 240);
+            } 
+        }
+        if ($data['keyword'] == '') {
+            //提取标题+内容中的关键词
+            $data['keyword'] = $data['title'];
+            //  . substr(str_replace(' ', '', strip_tags($data['content'])), 0, 20);
+            Jieba::init(); // 初始化 jieba-php
+            Finalseg::init();
+            $segList = Jieba::cut($data['keyword']);
+            $segList1 = array_slice($segList, 0, 8);
+            $data['keyword'] = implode(',', $segList1);
+        }
+        if ($data['introduce'] == '') {
+          //提取内容中的描述
+          // var_dump(11111);
+          $data['introduce'] = mb_substr(str_replace(' ', '', strip_tags($data['content'])), 0, 100);
+        }
+        if(isset($data['level']) && $data['level'] != null){
+            $data['level'] = intval($data['level']);
+        }else{
+            $data['level'] = null;
+        }
+        $user = User::where('id', $data['user_id'])->first();
+        if(empty($user)){
+            return Result::error('用户不存在!');
+        }
+        if($user['type_id']== 10000){
+            $data['status'] = 1;
+        }else{
+            $data['status'] = 0;
+        }
+        $result = Company::where('id', $data['id'])->update($data);
+        if ($result) {
+            return Result::success($result);
+        } else {
+            return Result::error('修改失败');
+        }
+    }
+    /**
+     * 删除企业
+     * @param array $data
+     * @return array
+     */
+    public function delCompany(array $data): array
+    {
+        $result = Company::where('id', $data['id'])->delete();
+        if ($result) {
+            return Result::success($result);
+        } else {
+            return Result::error('删除失败');
+        }
+    }
+    /**
+     * 审核企业
+     * @param array $data
+     * @return array
+     */
+    public function checkCompany(array $data): array
+    {
+        $user = User::where('id', $data['user_id'])->first();
+        if(empty($user)){
+            return Result::error('用户不存在!');
+        }
+        $company = Company::where('id', $data['id'])->first();
+        if(empty($company)){
+            return Result::error('企业不存在!');
+        }
+        // 状态:0:未审核 1:已审核 2:已拒绝
+        if($data['status'] == 2 || $data['status'] == '2'){
+          $result = Company::where('id', $data['id'])->update(['status' => $data['status'],'reject_reason'=> $data['reason']]);
+        }else{
+          $result = Company::where('id', $data['id'])->update(['status' => $data['status']]);
+        }
+        if(empty($result)){
+            return Result::error('审核失败!');
+        }else{
+            return Result::success($result);
+        }
+    }
+    /**
+     * 获取企业信息
+     * @param array $data
+     * @return array
+     */
+    public function getCompanyInfo(array $data): array
+    {
+        $result = Company::where('id', $data['id'])->first();
+        if(empty($result)){
+            return Result::error('企业不存在!');
+        }else{
+            return Result::success($result);
+        }
     }
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function getWebsiteCompany(array $data): array
+    {
+        $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($result);
+    }
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function getWebsiteCompanyList(array $data): array
+    {
+        $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);
+        }
+        $result = [
+            'count' => $query->clone()->count(),
+            'data' => $company,
+        ];
+        return Result::success($result);
+    }
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function getWebsiteCompanyInfo(array $data): array
+    {
+        $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($company);
+    }
+
+
+
 }

+ 22 - 0
app/JsonRpc/NewsServiceInterface.php

@@ -396,6 +396,21 @@ interface NewsServiceInterface
      */
     public function getWebsiteTsbbDetail(array $data):array;
     public function getWebsiteLevelJob(array $data):array;
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function getWebsiteCompany(array $data):array;
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function getWebsiteCompanyInfo(array $data):array;
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function getWebsiteCompanyList(array $data):array;
 
     /**
      * 农网导航首页
@@ -403,4 +418,11 @@ interface NewsServiceInterface
      * @return array
      */
     public function getWebsiteNwHomeList(array $data):array;
+    // --------------企业管理-----------
+    public function getCompanyList(array $data): array;
+    public function addCompany(array $data): array;
+    public function upCompany(array $data): array;
+    public function delCompany(array $data): array;
+    public function checkCompany(array $data): array;
+    public function getCompanyInfo(array $data): array;
 }

+ 3 - 3
app/Model/JobResume.php → app/Model/Company.php

@@ -8,17 +8,17 @@ use Hyperf\DbConnection\Model\Model;
 
 /**
  */
-class JobResume extends Model
+class Company extends Model
 {
     /**
      * The table associated with the model.
      */
-    protected ?string $table = 'job_resume';
+    protected ?string $table = 'company';
 
     /**
      * The attributes that are mass assignable.
      */
-    protected array $fillable = [];
+    protected array $guarded = [];
 
     /**
      * The attributes that should be cast to native types.

+ 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 = [];
-}

+ 40 - 40
composer.lock

@@ -1020,16 +1020,16 @@
         },
         {
             "name": "hyperf/cache",
-            "version": "v3.1.43",
+            "version": "v3.1.56",
             "source": {
                 "type": "git",
                 "url": "https://github.com/hyperf/cache.git",
-                "reference": "1e3cc54cee776c8d32cf40912dee5d366383bc33"
+                "reference": "4848c733560941490d9bf3aa8605deb4cce8fbf1"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/hyperf/cache/zipball/1e3cc54cee776c8d32cf40912dee5d366383bc33",
-                "reference": "1e3cc54cee776c8d32cf40912dee5d366383bc33",
+                "url": "https://api.github.com/repos/hyperf/cache/zipball/4848c733560941490d9bf3aa8605deb4cce8fbf1",
+                "reference": "4848c733560941490d9bf3aa8605deb4cce8fbf1",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -1093,7 +1093,7 @@
                     "type": "open_collective"
                 }
             ],
-            "time": "2024-10-09T10:22:39+00:00"
+            "time": "2025-06-05T06:13:29+00:00"
         },
         {
             "name": "hyperf/code-parser",
@@ -1309,16 +1309,16 @@
         },
         {
             "name": "hyperf/command",
-            "version": "v3.1.51",
+            "version": "v3.1.56",
             "source": {
                 "type": "git",
                 "url": "https://github.com/hyperf/command.git",
-                "reference": "e71af684e6f01140221b608b3d4f4cf6f78144fe"
+                "reference": "79188b44faff62e305fdb34cf2929ff517430e34"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/hyperf/command/zipball/e71af684e6f01140221b608b3d4f4cf6f78144fe",
-                "reference": "e71af684e6f01140221b608b3d4f4cf6f78144fe",
+                "url": "https://api.github.com/repos/hyperf/command/zipball/79188b44faff62e305fdb34cf2929ff517430e34",
+                "reference": "79188b44faff62e305fdb34cf2929ff517430e34",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -1370,7 +1370,7 @@
             ],
             "support": {
                 "issues": "https://github.com/hyperf/command/issues",
-                "source": "https://github.com/hyperf/command/tree/v3.1.51"
+                "source": "https://github.com/hyperf/command/tree/v3.1.56"
             },
             "funding": [
                 {
@@ -1382,7 +1382,7 @@
                     "type": "open_collective"
                 }
             ],
-            "time": "2025-02-06T03:40:37+00:00"
+            "time": "2025-06-03T08:26:34+00:00"
         },
         {
             "name": "hyperf/conditionable",
@@ -2026,16 +2026,16 @@
         },
         {
             "name": "hyperf/coroutine",
-            "version": "v3.1.52",
+            "version": "v3.1.54",
             "source": {
                 "type": "git",
                 "url": "https://github.com/hyperf/coroutine.git",
-                "reference": "223f0f9e17ee9dc8bf6e8da9e651296ba93e8d64"
+                "reference": "5b474c4bb46be015f1340939d92931b96a0b0cad"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/hyperf/coroutine/zipball/223f0f9e17ee9dc8bf6e8da9e651296ba93e8d64",
-                "reference": "223f0f9e17ee9dc8bf6e8da9e651296ba93e8d64",
+                "url": "https://api.github.com/repos/hyperf/coroutine/zipball/5b474c4bb46be015f1340939d92931b96a0b0cad",
+                "reference": "5b474c4bb46be015f1340939d92931b96a0b0cad",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -2047,7 +2047,7 @@
             "require": {
                 "hyperf/context": "~3.1.0",
                 "hyperf/contract": "~3.1.0",
-                "hyperf/engine": "^2.13.0",
+                "hyperf/engine": "^2.14.0",
                 "php": ">=8.1"
             },
             "type": "library",
@@ -2092,20 +2092,20 @@
                     "type": "open_collective"
                 }
             ],
-            "time": "2025-02-08T03:41:26+00:00"
+            "time": "2025-04-14T01:38:29+00:00"
         },
         {
             "name": "hyperf/database",
-            "version": "v3.1.53",
+            "version": "v3.1.56",
             "source": {
                 "type": "git",
                 "url": "https://github.com/hyperf/database.git",
-                "reference": "50f79d0bf6007f1c7ef63215426bb2f9cae83aa5"
+                "reference": "a4e5f11df6a74337836f1690c05506adf6e82f0f"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/hyperf/database/zipball/50f79d0bf6007f1c7ef63215426bb2f9cae83aa5",
-                "reference": "50f79d0bf6007f1c7ef63215426bb2f9cae83aa5",
+                "url": "https://api.github.com/repos/hyperf/database/zipball/a4e5f11df6a74337836f1690c05506adf6e82f0f",
+                "reference": "a4e5f11df6a74337836f1690c05506adf6e82f0f",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -2171,7 +2171,7 @@
                     "type": "open_collective"
                 }
             ],
-            "time": "2025-04-01T09:46:46+00:00"
+            "time": "2025-05-30T09:09:02+00:00"
         },
         {
             "name": "hyperf/db-connection",
@@ -6881,16 +6881,16 @@
         },
         {
             "name": "symfony/console",
-            "version": "v6.4.20",
+            "version": "v6.4.21",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/console.git",
-                "reference": "2e4af9c952617cc3f9559ff706aee420a8464c36"
+                "reference": "a3011c7b7adb58d89f6c0d822abb641d7a5f9719"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/console/zipball/2e4af9c952617cc3f9559ff706aee420a8464c36",
-                "reference": "2e4af9c952617cc3f9559ff706aee420a8464c36",
+                "url": "https://api.github.com/repos/symfony/console/zipball/a3011c7b7adb58d89f6c0d822abb641d7a5f9719",
+                "reference": "a3011c7b7adb58d89f6c0d822abb641d7a5f9719",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -6961,7 +6961,7 @@
                 "terminal"
             ],
             "support": {
-                "source": "https://github.com/symfony/console/tree/v6.4.20"
+                "source": "https://github.com/symfony/console/tree/v6.4.21"
             },
             "funding": [
                 {
@@ -6977,7 +6977,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2025-03-03T17:16:38+00:00"
+            "time": "2025-04-07T15:42:41+00:00"
         },
         {
             "name": "symfony/deprecation-contracts",
@@ -8841,16 +8841,16 @@
         },
         {
             "name": "hyperf/watcher",
-            "version": "v3.1.43",
+            "version": "v3.1.54",
             "source": {
                 "type": "git",
                 "url": "https://github.com/hyperf/watcher.git",
-                "reference": "a5f41a66a8b8f651335b4a7c403e03ff0b0f4802"
+                "reference": "c92dc6bd94c6e2369a3de262a700550427041b70"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/hyperf/watcher/zipball/a5f41a66a8b8f651335b4a7c403e03ff0b0f4802",
-                "reference": "a5f41a66a8b8f651335b4a7c403e03ff0b0f4802",
+                "url": "https://api.github.com/repos/hyperf/watcher/zipball/c92dc6bd94c6e2369a3de262a700550427041b70",
+                "reference": "c92dc6bd94c6e2369a3de262a700550427041b70",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -8897,7 +8897,7 @@
             ],
             "support": {
                 "issues": "https://github.com/hyperf/watcher/issues",
-                "source": "https://github.com/hyperf/watcher/tree/v3.1.43"
+                "source": "https://github.com/hyperf/watcher/tree/v3.1.54"
             },
             "funding": [
                 {
@@ -8909,7 +8909,7 @@
                     "type": "open_collective"
                 }
             ],
-            "time": "2024-10-06T12:33:12+00:00"
+            "time": "2025-04-26T13:02:01+00:00"
         },
         {
             "name": "mockery/mockery",
@@ -11656,16 +11656,16 @@
         },
         {
             "name": "symfony/options-resolver",
-            "version": "v6.4.13",
+            "version": "v6.4.16",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/options-resolver.git",
-                "reference": "0a62a9f2504a8dd27083f89d21894ceb01cc59db"
+                "reference": "368128ad168f20e22c32159b9f761e456cec0c78"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/options-resolver/zipball/0a62a9f2504a8dd27083f89d21894ceb01cc59db",
-                "reference": "0a62a9f2504a8dd27083f89d21894ceb01cc59db",
+                "url": "https://api.github.com/repos/symfony/options-resolver/zipball/368128ad168f20e22c32159b9f761e456cec0c78",
+                "reference": "368128ad168f20e22c32159b9f761e456cec0c78",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -11709,7 +11709,7 @@
                 "options"
             ],
             "support": {
-                "source": "https://github.com/symfony/options-resolver/tree/v6.4.13"
+                "source": "https://github.com/symfony/options-resolver/tree/v6.4.16"
             },
             "funding": [
                 {
@@ -11725,7 +11725,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2024-09-25T14:18:03+00:00"
+            "time": "2024-11-20T10:57:02+00:00"
         },
         {
             "name": "symfony/polyfill-php81",

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
runtime/container/classes.cache


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
runtime/container/scan.cache


+ 1 - 1
runtime/hyperf.pid

@@ -1 +1 @@
-52055
+52968

+ 0 - 7
runtime/logs/hyperf.log

@@ -1,7 +0,0 @@
-[2024-12-30T06:38:12.496098+00:00] sql.INFO: [709.21] select `category`.*, `category`.`id` as `category_id` from `category` where (`pid` = '7') [] []
-[2024-12-30T06:38:47.428649+00:00] sql.INFO: [17.24] select `category`.*, `category`.`id` as `category_id` from `category` where (`pid` = '5') [] []
-[2024-12-30T06:51:39.863013+00:00] sql.INFO: [65.56] select `category`.*, `category`.`id` as `category_id` from `category` where (`pid` = '5') [] []
-[2024-12-30T06:54:42.876483+00:00] sql.INFO: [68.75] select `category`.*, `category`.`id` as `category_id` from `category` where (`pid` = '5') [] []
-[2024-12-30T06:54:56.791140+00:00] sql.INFO: [3328.19] select `category`.*, `category`.`id` as `category_id` from `category` where (`pid` = '0') [] []
-[2024-12-30T06:56:06.854836+00:00] sql.INFO: [67] select `category`.*, `category`.`id` as `category_id` from `category` where (`pid` = '0') [] []
-[2024-12-30T06:56:15.144154+00:00] sql.INFO: [17.25] select `category`.*, `category`.`id` as `category_id` from `category` where (`pid` = '5') [] []

+ 1 - 1
vendor/autoload.php

@@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
 
 require_once __DIR__ . '/composer/autoload_real.php';
 
-return ComposerAutoloaderInit88f2a4d4a4e81dc7d415bcdf39930654::getLoader();
+return ComposerAutoloaderInit93d050353fc587b1b1fb188f0a8c068c::getLoader();

+ 4 - 23
vendor/composer/InstalledVersions.php

@@ -32,11 +32,6 @@ class InstalledVersions
      */
     private static $installed;
 
-    /**
-     * @var bool
-     */
-    private static $installedIsLocalDir;
-
     /**
      * @var bool|null
      */
@@ -314,12 +309,6 @@ class InstalledVersions
     {
         self::$installed = $data;
         self::$installedByVendor = array();
-
-        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
-        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
-        // so we have to assume it does not, and that may result in duplicate data being returned when listing
-        // all installed packages for example
-        self::$installedIsLocalDir = false;
     }
 
     /**
@@ -333,27 +322,19 @@ class InstalledVersions
         }
 
         $installed = array();
-        $copiedLocalDir = false;
 
         if (self::$canGetVendors) {
-            $selfDir = strtr(__DIR__, '\\', '/');
             foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
-                $vendorDir = strtr($vendorDir, '\\', '/');
                 if (isset(self::$installedByVendor[$vendorDir])) {
                     $installed[] = self::$installedByVendor[$vendorDir];
                 } elseif (is_file($vendorDir.'/composer/installed.php')) {
                     /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
                     $required = require $vendorDir.'/composer/installed.php';
-                    self::$installedByVendor[$vendorDir] = $required;
-                    $installed[] = $required;
-                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
-                        self::$installed = $required;
-                        self::$installedIsLocalDir = true;
+                    $installed[] = self::$installedByVendor[$vendorDir] = $required;
+                    if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
+                        self::$installed = $installed[count($installed) - 1];
                     }
                 }
-                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
-                    $copiedLocalDir = true;
-                }
             }
         }
 
@@ -369,7 +350,7 @@ class InstalledVersions
             }
         }
 
-        if (self::$installed !== array() && !$copiedLocalDir) {
+        if (self::$installed !== array()) {
             $installed[] = self::$installed;
         }
 

+ 1 - 0
vendor/composer/autoload_classmap.php

@@ -24,6 +24,7 @@ return array(
     'App\\Model\\ChatGroups' => $baseDir . '/app/Model/ChatGroups.php',
     'App\\Model\\ChatGroupsMember' => $baseDir . '/app/Model/ChatGroupsMember.php',
     'App\\Model\\ChatRecords' => $baseDir . '/app/Model/ChatRecords.php',
+    'App\\Model\\Company' => $baseDir . '/app/Model/Company.php',
     'App\\Model\\Couplet' => $baseDir . '/app/Model/Couplet.php',
     'App\\Model\\District' => $baseDir . '/app/Model/District.php',
     'App\\Model\\Festival' => $baseDir . '/app/Model/Festival.php',

+ 5 - 5
vendor/composer/autoload_real.php

@@ -2,7 +2,7 @@
 
 // autoload_real.php @generated by Composer
 
-class ComposerAutoloaderInit88f2a4d4a4e81dc7d415bcdf39930654
+class ComposerAutoloaderInit93d050353fc587b1b1fb188f0a8c068c
 {
     private static $loader;
 
@@ -24,16 +24,16 @@ class ComposerAutoloaderInit88f2a4d4a4e81dc7d415bcdf39930654
 
         require __DIR__ . '/platform_check.php';
 
-        spl_autoload_register(array('ComposerAutoloaderInit88f2a4d4a4e81dc7d415bcdf39930654', 'loadClassLoader'), true, true);
+        spl_autoload_register(array('ComposerAutoloaderInit93d050353fc587b1b1fb188f0a8c068c', 'loadClassLoader'), true, true);
         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
-        spl_autoload_unregister(array('ComposerAutoloaderInit88f2a4d4a4e81dc7d415bcdf39930654', 'loadClassLoader'));
+        spl_autoload_unregister(array('ComposerAutoloaderInit93d050353fc587b1b1fb188f0a8c068c', 'loadClassLoader'));
 
         require __DIR__ . '/autoload_static.php';
-        call_user_func(\Composer\Autoload\ComposerStaticInit88f2a4d4a4e81dc7d415bcdf39930654::getInitializer($loader));
+        call_user_func(\Composer\Autoload\ComposerStaticInit93d050353fc587b1b1fb188f0a8c068c::getInitializer($loader));
 
         $loader->register(true);
 
-        $filesToLoad = \Composer\Autoload\ComposerStaticInit88f2a4d4a4e81dc7d415bcdf39930654::$files;
+        $filesToLoad = \Composer\Autoload\ComposerStaticInit93d050353fc587b1b1fb188f0a8c068c::$files;
         $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
             if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
                 $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

+ 5 - 4
vendor/composer/autoload_static.php

@@ -4,7 +4,7 @@
 
 namespace Composer\Autoload;
 
-class ComposerStaticInit88f2a4d4a4e81dc7d415bcdf39930654
+class ComposerStaticInit93d050353fc587b1b1fb188f0a8c068c
 {
     public static $files = array (
         '9c7a683baffd24f5595c1dc5f5273030' => __DIR__ . '/..' . '/hyperf/engine/src/Functions.php',
@@ -775,6 +775,7 @@ class ComposerStaticInit88f2a4d4a4e81dc7d415bcdf39930654
         'App\\Model\\ChatGroups' => __DIR__ . '/../..' . '/app/Model/ChatGroups.php',
         'App\\Model\\ChatGroupsMember' => __DIR__ . '/../..' . '/app/Model/ChatGroupsMember.php',
         'App\\Model\\ChatRecords' => __DIR__ . '/../..' . '/app/Model/ChatRecords.php',
+        'App\\Model\\Company' => __DIR__ . '/../..' . '/app/Model/Company.php',
         'App\\Model\\Couplet' => __DIR__ . '/../..' . '/app/Model/Couplet.php',
         'App\\Model\\District' => __DIR__ . '/../..' . '/app/Model/District.php',
         'App\\Model\\Festival' => __DIR__ . '/../..' . '/app/Model/Festival.php',
@@ -5793,9 +5794,9 @@ class ComposerStaticInit88f2a4d4a4e81dc7d415bcdf39930654
     public static function getInitializer(ClassLoader $loader)
     {
         return \Closure::bind(function () use ($loader) {
-            $loader->prefixLengthsPsr4 = ComposerStaticInit88f2a4d4a4e81dc7d415bcdf39930654::$prefixLengthsPsr4;
-            $loader->prefixDirsPsr4 = ComposerStaticInit88f2a4d4a4e81dc7d415bcdf39930654::$prefixDirsPsr4;
-            $loader->classMap = ComposerStaticInit88f2a4d4a4e81dc7d415bcdf39930654::$classMap;
+            $loader->prefixLengthsPsr4 = ComposerStaticInit93d050353fc587b1b1fb188f0a8c068c::$prefixLengthsPsr4;
+            $loader->prefixDirsPsr4 = ComposerStaticInit93d050353fc587b1b1fb188f0a8c068c::$prefixDirsPsr4;
+            $loader->classMap = ComposerStaticInit93d050353fc587b1b1fb188f0a8c068c::$classMap;
 
         }, null, ClassLoader::class);
     }

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 410 - 92
vendor/composer/installed.json


+ 23 - 23
vendor/composer/installed.php

@@ -3,7 +3,7 @@
         'name' => 'hyperf/hyperf-skeleton',
         'pretty_version' => 'dev-master',
         'version' => 'dev-master',
-        'reference' => '558bc6fbabb165938593827ac74dabb42c5c7598',
+        'reference' => '9d12071cf0586267e5cb1c8008d745bd7632820e',
         'type' => 'project',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
@@ -203,9 +203,9 @@
             'dev_requirement' => true,
         ),
         'hyperf/cache' => array(
-            'pretty_version' => 'v3.1.43',
-            'version' => '3.1.43.0',
-            'reference' => '1e3cc54cee776c8d32cf40912dee5d366383bc33',
+            'pretty_version' => 'v3.1.56',
+            'version' => '3.1.56.0',
+            'reference' => '4848c733560941490d9bf3aa8605deb4cce8fbf1',
             'type' => 'library',
             'install_path' => __DIR__ . '/../hyperf/cache',
             'aliases' => array(),
@@ -239,9 +239,9 @@
             'dev_requirement' => false,
         ),
         'hyperf/command' => array(
-            'pretty_version' => 'v3.1.51',
-            'version' => '3.1.51.0',
-            'reference' => 'e71af684e6f01140221b608b3d4f4cf6f78144fe',
+            'pretty_version' => 'v3.1.56',
+            'version' => '3.1.56.0',
+            'reference' => '79188b44faff62e305fdb34cf2929ff517430e34',
             'type' => 'library',
             'install_path' => __DIR__ . '/../hyperf/command',
             'aliases' => array(),
@@ -329,18 +329,18 @@
             'dev_requirement' => false,
         ),
         'hyperf/coroutine' => array(
-            'pretty_version' => 'v3.1.52',
-            'version' => '3.1.52.0',
-            'reference' => '223f0f9e17ee9dc8bf6e8da9e651296ba93e8d64',
+            'pretty_version' => 'v3.1.54',
+            'version' => '3.1.54.0',
+            'reference' => '5b474c4bb46be015f1340939d92931b96a0b0cad',
             'type' => 'library',
             'install_path' => __DIR__ . '/../hyperf/coroutine',
             'aliases' => array(),
             'dev_requirement' => false,
         ),
         'hyperf/database' => array(
-            'pretty_version' => 'v3.1.53',
-            'version' => '3.1.53.0',
-            'reference' => '50f79d0bf6007f1c7ef63215426bb2f9cae83aa5',
+            'pretty_version' => 'v3.1.56',
+            'version' => '3.1.56.0',
+            'reference' => 'a4e5f11df6a74337836f1690c05506adf6e82f0f',
             'type' => 'library',
             'install_path' => __DIR__ . '/../hyperf/database',
             'aliases' => array(),
@@ -457,7 +457,7 @@
         'hyperf/hyperf-skeleton' => array(
             'pretty_version' => 'dev-master',
             'version' => 'dev-master',
-            'reference' => '558bc6fbabb165938593827ac74dabb42c5c7598',
+            'reference' => '9d12071cf0586267e5cb1c8008d745bd7632820e',
             'type' => 'project',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),
@@ -698,9 +698,9 @@
             'dev_requirement' => false,
         ),
         'hyperf/watcher' => array(
-            'pretty_version' => 'v3.1.43',
-            'version' => '3.1.43.0',
-            'reference' => 'a5f41a66a8b8f651335b4a7c403e03ff0b0f4802',
+            'pretty_version' => 'v3.1.54',
+            'version' => '3.1.54.0',
+            'reference' => 'c92dc6bd94c6e2369a3de262a700550427041b70',
             'type' => 'library',
             'install_path' => __DIR__ . '/../hyperf/watcher',
             'aliases' => array(),
@@ -1349,9 +1349,9 @@
             'dev_requirement' => false,
         ),
         'symfony/console' => array(
-            'pretty_version' => 'v6.4.20',
-            'version' => '6.4.20.0',
-            'reference' => '2e4af9c952617cc3f9559ff706aee420a8464c36',
+            'pretty_version' => 'v6.4.21',
+            'version' => '6.4.21.0',
+            'reference' => 'a3011c7b7adb58d89f6c0d822abb641d7a5f9719',
             'type' => 'library',
             'install_path' => __DIR__ . '/../symfony/console',
             'aliases' => array(),
@@ -1418,9 +1418,9 @@
             'dev_requirement' => true,
         ),
         'symfony/options-resolver' => array(
-            'pretty_version' => 'v6.4.13',
-            'version' => '6.4.13.0',
-            'reference' => '0a62a9f2504a8dd27083f89d21894ceb01cc59db',
+            'pretty_version' => 'v6.4.16',
+            'version' => '6.4.16.0',
+            'reference' => '368128ad168f20e22c32159b9f761e456cec0c78',
             'type' => 'library',
             'install_path' => __DIR__ . '/../symfony/options-resolver',
             'aliases' => array(),

+ 3 - 1
vendor/hyperf/cache/src/Annotation/CacheAhead.php

@@ -24,6 +24,7 @@ class CacheAhead extends AbstractAnnotation
 {
     /**
      * @param null|int $ttl the max offset for ttl
+     * @param bool $runAsync when this method is executed for the first time, the original method is executed asynchronously and cached, so the return value is null
      */
     public function __construct(
         public ?string $prefix = null,
@@ -34,7 +35,8 @@ class CacheAhead extends AbstractAnnotation
         public int $offset = 0,
         public string $group = 'default',
         public bool $collect = false,
-        public ?array $skipCacheResults = null
+        public ?array $skipCacheResults = null,
+        public bool $runAsync = false,
     ) {
     }
 

+ 8 - 0
vendor/hyperf/cache/src/Aspect/CacheAheadAspect.php

@@ -39,6 +39,9 @@ class CacheAheadAspect extends AbstractAspect
         $arguments = $proceedingJoinPoint->arguments['keys'];
         $now = time();
 
+        /**
+         * @var CacheAhead $annotation
+         */
         [$key, $ttl, $group, $annotation] = $this->annotationManager->getCacheAheadValue($className, $method, $arguments);
         $driver = $this->manager->getDriver($group);
 
@@ -78,6 +81,11 @@ class CacheAheadAspect extends AbstractAspect
         }
 
         // If the cache does not exist, execute the callback and cache the result.
+        if ($annotation->runAsync) {
+            Coroutine::create($callback);
+            return null;
+        }
+
         return $callback();
     }
 }

+ 1 - 1
vendor/hyperf/cache/src/Driver/CoroutineMemoryDriver.php

@@ -53,7 +53,7 @@ class CoroutineMemoryDriver extends Driver implements KeyCollectorInterface
     public function setMultiple($values, $ttl = null): bool
     {
         foreach ($values as $key => $value) {
-            $this->set($key, $values, $ttl);
+            $this->set($key, $value, $ttl);
         }
 
         return true;

+ 2 - 0
vendor/hyperf/command/src/AsCommand.php

@@ -29,9 +29,11 @@ final class AsCommand extends Command
         string $signature,
         private string $class,
         private string $method,
+        bool $coroutine = true,
     ) {
         $this->signature = $signature;
         $this->parameterParser = $container->get(ParameterParser::class);
+        $this->coroutine = $coroutine;
 
         parent::__construct();
 

+ 7 - 0
vendor/hyperf/command/src/ClosureCommand.php

@@ -75,6 +75,13 @@ final class ClosureCommand extends Command
         return $this;
     }
 
+    public function coroutine(bool $coroutine): self
+    {
+        $this->coroutine = $coroutine;
+
+        return $this;
+    }
+
     /**
      * @param null|callable(Crontab $crontab):Crontab $callback
      */

+ 1 - 1
vendor/hyperf/coroutine/composer.json

@@ -19,7 +19,7 @@
         "php": ">=8.1",
         "hyperf/context": "~3.1.0",
         "hyperf/contract": "~3.1.0",
-        "hyperf/engine": "^2.13.0"
+        "hyperf/engine": "^2.14.0"
     },
     "autoload": {
         "psr-4": {

+ 7 - 2
vendor/hyperf/database/src/Commands/ModelCommand.php

@@ -158,10 +158,15 @@ class ModelCommand extends Command
         $table = Str::replaceFirst($option->getPrefix(), '', $table);
         $pureTable = Str::after($table, '.');
         $databaseName = Str::contains($table, '.') ? Str::before($table, '.') : null;
-        $columns = $this->formatColumns($builder->getColumnTypeListing($pureTable, $databaseName));
+        $driver = $this->resolver->connection($option->getPool())->getConfig('driver');
+        $columns = match ($driver) {
+            'pgsql' => $this->formatColumns($builder->getColumnTypeListing($table, $databaseName)),
+            default => $this->formatColumns($builder->getColumnTypeListing($pureTable, $databaseName)),
+        };
+
         if (empty($columns)) {
             $this->output?->error(
-                sprintf('Query columns empty, maybe is table `%s` does not exist.You can check it in database.', $table)
+                sprintf('Query columns are empty, maybe the table `%s` does not exist. You can check it in the database.', $table)
             );
         }
 

+ 9 - 0
vendor/hyperf/database/src/Schema/Blueprint.php

@@ -153,6 +153,10 @@ class Blueprint
         $this->ensureCommandsAreValid($connection);
 
         foreach ($this->commands as $command) {
+            if ($command->shouldBeSkipped) {
+                continue;
+            }
+
             $method = 'compile' . ucfirst($command->name);
 
             if (method_exists($grammar, $method)) {
@@ -1488,6 +1492,11 @@ class Blueprint
         $this->addFluentIndexes();
 
         $this->addFluentCommands($grammar);
+
+        // Add table comment command for PostgreSQL if table has comment and is being created
+        if ($this->creating() && ! empty($this->comment) && in_array('TableComment', $grammar->getFluentCommands())) {
+            $this->addCommand('tableComment', ['value' => $this->comment]);
+        }
     }
 
     /**

+ 13 - 1
vendor/hyperf/database/src/Schema/Grammars/MySqlGrammar.php

@@ -529,11 +529,23 @@ class MySqlGrammar extends Grammar
      */
     protected function compileCreateTable($blueprint, $command, $connection)
     {
+        $tableStructure = $this->getColumns($blueprint);
+
+        if ($primaryKey = $this->getCommandByName($blueprint, 'primary')) {
+            $tableStructure[] = sprintf(
+                'primary key %s(%s)',
+                $primaryKey->algorithm ? 'using ' . $primaryKey->algorithm : '',
+                $this->columnize($primaryKey->columns)
+            );
+
+            $primaryKey->shouldBeSkipped = true;
+        }
+
         return sprintf(
             '%s table %s (%s)',
             $blueprint->temporary ? 'create temporary' : 'create',
             $this->wrapTable($blueprint),
-            implode(', ', $this->getColumns($blueprint))
+            implode(', ', $tableStructure)
         );
     }
 

+ 1 - 1
vendor/hyperf/watcher/src/Watcher.php

@@ -77,7 +77,7 @@ class Watcher
                 }
             } else {
                 $ret = exec(sprintf('%s %s/vendor/hyperf/watcher/collector-reload.php %s', $this->option->getBin(), BASE_PATH, $file));
-                if ($ret['code'] === 0) {
+                if (isset($ret['code']) && $ret['code'] === 0) {
                     $this->output->writeln('Class reload success.');
                 } else {
                     $this->output->writeln('Class reload failed.');

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä