调整列表
This commit is contained in:
@@ -181,6 +181,7 @@ function getArtilesByCates($cate_id, $take = 8)
|
||||
{
|
||||
$cate_ids = Category::where('parent_id', $cate_id)
|
||||
->orWhere('id', $cate_id)
|
||||
->where('status', 1)
|
||||
->whereIn('type', [Category::TYPE_ARTICLE, Category::TYPE_SHOW])
|
||||
->pluck('id')
|
||||
->toArray();
|
||||
|
||||
@@ -38,7 +38,14 @@ class CategoryController extends Controller
|
||||
$template = 'category.persons';
|
||||
}
|
||||
|
||||
$articles = Article::where('category_id', $category->id)
|
||||
$cate_ids = Category::where('parent_id', $category->id)
|
||||
->orWhere('id', $category->id)
|
||||
->where('status', 1)
|
||||
->whereIn('type', [Category::TYPE_ARTICLE, Category::TYPE_SHOW])
|
||||
->pluck('id')
|
||||
->toArray();
|
||||
|
||||
$articles = Article::whereIn('category_id', $cate_ids)
|
||||
->where('status', 1)
|
||||
->latest('sort')
|
||||
->latest()
|
||||
|
||||
Reference in New Issue
Block a user