From 70d66e7dd85db8df574d053772d9704caf090c32 Mon Sep 17 00:00:00 2001 From: Azareal Date: Wed, 20 Jan 2021 18:10:50 +1000 Subject: [PATCH] fix has param logic fix paginator for search user by group --- routes/panel/users.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routes/panel/users.go b/routes/panel/users.go index 54e788d8..20b6f0c8 100644 --- a/routes/panel/users.go +++ b/routes/panel/users.go @@ -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}}