|
@@ -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')
|