微调
This commit is contained in:
@@ -19,8 +19,8 @@ class CategoryController extends Controller
|
|||||||
$parent = getTopCate($category->id);
|
$parent = getTopCate($category->id);
|
||||||
|
|
||||||
$template = array_flip(config('haai.category'));
|
$template = array_flip(config('haai.category'));
|
||||||
if (isset($template[$category->id]) && !in_array($category->id, config('haai.no_list'))) {
|
if (isset($template[$category->id]) && ! in_array($category->id, config('haai.no_list'))) {
|
||||||
return view('category.' . $template[$category->id], compact('category', 'parent'));
|
return view('category.'.$template[$category->id], compact('category', 'parent'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect(route('category.list', $category));
|
return redirect(route('category.list', $category));
|
||||||
@@ -57,6 +57,10 @@ class CategoryController extends Controller
|
|||||||
$parent = $category->parent;
|
$parent = $category->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($category->children->isEmpty()) {
|
||||||
|
$parent = $category->parent;
|
||||||
|
}
|
||||||
|
|
||||||
return view($template, compact('category', 'parent', 'articles'));
|
return view($template, compact('category', 'parent', 'articles'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user