调整模板显示数量
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user