调整模板显示数量

This commit is contained in:
2022-07-08 16:10:04 +08:00
parent 1e82a9ebeb
commit 7ef285be6c

View File

@@ -9,6 +9,7 @@ use App\Models\Leader;
class CategoryController extends Controller class CategoryController extends Controller
{ {
public $pageNum = 15;
/** /**
* 显示分类 * 显示分类
@@ -34,10 +35,15 @@ class CategoryController extends Controller
$parent = $category->parent; $parent = $category->parent;
} }
$pageNum = $this->pageNum;
if ($category->template == 'list_image_title_des_date') {
$pageNum = 6;
}
$articles = Article::shown()->ByCategory($category->getAllChildrenId()) $articles = Article::shown()->ByCategory($category->getAllChildrenId())
->where('status', 1) ->where('status', 1)
->Bysort() ->Bysort()
->paginate(); ->paginate($pageNum);
$data = [ $data = [
'articles' => $articles, 'articles' => $articles,