Browse Source

贴身宝贝-获取栏目id

rkljw 1 day ago
parent
commit
2dc7aa80cf
2 changed files with 9 additions and 5 deletions
  1. 8 4
      app/JsonRpc/NewsService.php
  2. 1 1
      runtime/hyperf.pid

+ 8 - 4
app/JsonRpc/NewsService.php

@@ -5372,9 +5372,9 @@ class NewsService implements NewsServiceInterface
     $container = \Hyperf\Context\ApplicationContext::getContainer();
     $cache = $container->get(\Psr\SimpleCache\CacheInterface::class);
 
-    if ($cachedData = $cache->get($cacheKey)) {
-      return Result::success(unserialize($cachedData));
-    }
+     if ($cachedData = $cache->get($cacheKey)) {
+       return Result::success(unserialize($cachedData));
+     }
 
     //查询老黄历
     try {
@@ -5457,7 +5457,11 @@ class NewsService implements NewsServiceInterface
       ->limit(6)
       ->get();
     // 获取分类文章数据
-    $categoryIds = [627, 628, 629, 630, 631, 632, 633, 634, 635, 636];
+      $categoryIds =  WebsiteCategory::where(['website_id'=> $data['website_id'], 'pid'=>0])
+    ->pluck('category_id')
+    ->toArray();
+
+//    $categoryIds = [627, 628, 629, 630, 631, 632, 633, 634, 635, 636];
 
     // 使用子查询优化
     $articlesList = DB::table('article')

+ 1 - 1
runtime/hyperf.pid

@@ -1 +1 @@
-28587
+3682