调整但行

This commit is contained in:
2021-02-04 10:50:46 +08:00
parent 735ce6a4ca
commit 0e70658aeb
8 changed files with 62 additions and 25 deletions

View File

@@ -182,10 +182,12 @@ function getArtilesByCates($cate_id, $take = 8)
$cate_ids = Category::where('parent_id', $cate_id)
->orWhere('id', $cate_id)
->whereIn('type', [Category::TYPE_ARTICLE, Category::TYPE_SHOW])
->get();
->pluck('id')
->toArray();
return Article::whereIn('category_id', $cate_ids)
->latest()
->take($take)
->get();
}