Skip to content

indraw/class.page

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

class.page

a go class for page

找半天分页类,没有?自己写一个吧

#用法:

1、调用分页方法

page := util.NewPageMaker(num, p, "list")
userList := user.list(page)

2、Dao获取数据

func (u *User) list(page *util.PageMaker) []UserData {
    var l []UserData
    u.c.Find(nil).Sort("-_id").Skip(page.Begin).Limit(page.PerPage).All(&l)
    return l
}

#显示: 第一页 << 11 12 13 14 15 >> 最后页

About

a go class for page

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published