阶段更新

This commit is contained in:
2021-10-11 15:56:12 +08:00
parent 11b9e2ae76
commit 3381820ba0
17 changed files with 319 additions and 534 deletions

View File

@@ -18,17 +18,19 @@ class CategoryController extends Controller
{
if ($category->type == Category::TYPE_SHOW && $category->article_id) {
return redirect("articles/" . $category->article_id);
} elseif ($category->type == Category::TYPE_LINK && $category->url) {
return redirect()->away($category->url);
} else {
$template = 'show';
if ($category->template) {
$template = $category->template;
}
$articles = $category->relations(Category::TYPE_ARTICLE)
$articles = $category->relations($category->type)
->where('status', 1)
->latest('sort')
->latest('created_at')
->paginate(8);
->paginate();
$parent = $category;
if ($category->childrens->isEmpty() && $category->parent) {