mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-18 09:44:26 +08:00
项目空间数量超过分页数量后不显示的bug修复
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"math"
|
||||
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
"github.com/mindoc-org/mindoc/conf"
|
||||
@@ -24,7 +26,7 @@ func (c *ItemsetsController) Prepare() {
|
||||
func (c *ItemsetsController) Index() {
|
||||
c.Prepare()
|
||||
c.TplName = "items/index.tpl"
|
||||
pageSize := 18
|
||||
pageSize := 16
|
||||
|
||||
pageIndex, _ := c.GetInt("page", 0)
|
||||
|
||||
@@ -33,7 +35,6 @@ func (c *ItemsetsController) Index() {
|
||||
if err != nil && err != orm.ErrNoRows {
|
||||
c.ShowErrorPage(500, err.Error())
|
||||
}
|
||||
c.Data["TotalPages"] = pageIndex
|
||||
if err == orm.ErrNoRows || len(items) <= 0 {
|
||||
c.Data["Lists"] = items
|
||||
c.Data["PageHtml"] = ""
|
||||
@@ -46,7 +47,7 @@ func (c *ItemsetsController) Index() {
|
||||
} else {
|
||||
c.Data["PageHtml"] = ""
|
||||
}
|
||||
|
||||
c.Data["TotalPages"] = int(math.Ceil(float64(totalCount) / float64(pageSize)))
|
||||
c.Data["Lists"] = items
|
||||
}
|
||||
|
||||
@@ -85,6 +86,7 @@ func (c *ItemsetsController) List() {
|
||||
} else {
|
||||
c.Data["PageHtml"] = ""
|
||||
}
|
||||
c.Data["TotalPages"] = int(math.Ceil(float64(totalCount) / float64(pageSize)))
|
||||
c.Data["Lists"] = searchResult
|
||||
|
||||
c.Data["Model"] = item
|
||||
|
Reference in New Issue
Block a user