修复首页不显示分页的BUG

This commit is contained in:
Minho
2017-05-31 10:15:04 +08:00
parent 80c7f25223
commit 6686de168c
4 changed files with 25 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ import (
"github.com/astaxie/beego"
"github.com/lifei6671/godoc/models"
"github.com/lifei6671/godoc/utils"
"math"
)
type HomeController struct {
@@ -38,6 +39,7 @@ func (c *HomeController) Index() {
}else {
c.Data["PageHtml"] = ""
}
c.Data["TotalPages"] = int(math.Ceil(float64(totalCount) / float64(pageSize)))
c.Data["Lists"] = books