调整页面

This commit is contained in:
2020-09-18 13:45:13 +08:00
parent 46d12cbf68
commit b8024dcace
14 changed files with 268 additions and 50 deletions

View File

@@ -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'));
}
}