调整页面
This commit is contained in:
@@ -30,10 +30,23 @@ class CategoryController extends Controller
|
||||
//显示文章列表
|
||||
public function list(Category $category)
|
||||
{
|
||||
$articles = Article::where('category_id', $category->id)->where('status', 1)->paginate();
|
||||
$parent = getTopCate($category->id);
|
||||
$take = 15;
|
||||
$template = 'category.list';
|
||||
|
||||
return view('category.list', compact('category', 'parent', 'articles'));
|
||||
if (in_array($category->id, [29, 30])) {
|
||||
$take = 16;
|
||||
$template = 'category.persons';
|
||||
}
|
||||
|
||||
$articles = Article::where('category_id', $category->id)
|
||||
->where('status', 1)
|
||||
->latest('sort')
|
||||
->latest()
|
||||
->paginate($take);
|
||||
|
||||
$parent = getTopCate($category->id);
|
||||
|
||||
return view($template, compact('category', 'parent', 'articles'));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user