调整院所网站

This commit is contained in:
2022-08-19 17:30:44 +08:00
parent a1e2085bcb
commit 4751739f3c
2 changed files with 81 additions and 37 deletions

View File

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