阶段更新
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user