fix has param logic

fix paginator for search user by group
This commit is contained in:
Azareal 2021-01-20 18:10:50 +10:00
parent f69e077347
commit 70d66e7dd8

View File

@ -35,7 +35,7 @@ func Users(w http.ResponseWriter, r *http.Request, u *c.User) c.RouteError {
/*if group == "" {
gid = -1
}*/
hasParam = hasParam && gid > 0
hasParam = hasParam || gid > 0
page, _ := strconv.Atoi(r.FormValue("page"))
perPage := 15
@ -72,6 +72,9 @@ func Users(w http.ResponseWriter, r *http.Request, u *c.User) c.RouteError {
if email != "" {
params += "s-email=" + email + "&"
}
if gid > 0 {
params += "s-group=" + strconv.Itoa(gid) + "&"
}
}
pageList := c.Paginate(page, lastPage, 5)
pi := c.PanelUserPage{basePage, users, allGroups, search, c.PaginatorMod{template.URL(params), pageList, page, lastPage}}