调整院所网站
This commit is contained in:
@@ -38,12 +38,18 @@ class CategoryController extends Controller
|
||||
$template = 'category.persons';
|
||||
}
|
||||
|
||||
$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();
|
||||
if ($category->id == 74) {
|
||||
$categories = Category::get();
|
||||
$cate_ids = getAllChild($categories, $category->id);
|
||||
} else {
|
||||
$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::where('status', 1)
|
||||
->ByCategory($cate_ids)
|
||||
|
||||
Reference in New Issue
Block a user