初步完成
This commit is contained in:
@@ -16,8 +16,10 @@ class ArticleController extends Controller
|
||||
*/
|
||||
public function show(Article $article)
|
||||
{
|
||||
$category = $article->category;
|
||||
$parent = getTopCate($category->id);
|
||||
$parent = $category = $article->category;
|
||||
if ($category->id) {
|
||||
$parent = getTopCate($category->id);
|
||||
}
|
||||
|
||||
$next = Article::where('id', '>', $article->id)
|
||||
->where('category_id', $article->category_id)
|
||||
@@ -36,6 +38,7 @@ class ArticleController extends Controller
|
||||
->when($title, function ($q) use ($title) {
|
||||
$q->where('title', 'like', "%{$title}%");
|
||||
})
|
||||
->where('category_id', '>', 0)
|
||||
->paginate();
|
||||
|
||||
return view('article.search', compact('articles'));
|
||||
|
||||
Reference in New Issue
Block a user