@@ -18,25 +18,25 @@ class UserAdminController {
1818 def users
1919 def totalCount
2020
21- // if (groupId) {
22- // def sort = params.sort ? ("user."+params.sort) : "user.fullName"
23- // users = UserRoleGroup.createCriteria().list(max: params.max, offset: params.offset, sort: sort, order: params.order) {
24- // eq("roleGroup.id", groupId)
25- // }.collect { it.user }
26- //
27- // totalCount = UserRoleGroup.where { roleGroup.id == groupId }.count()
28- // } else {
29- // def query
30- // if (affiliationId) {
31- // query = User.where { affiliation.id == affiliationId }
32- // } else if (isEnabled != null && isEnabled != "") {
33- // query = User.where { enabled == isEnabled }
34- // } else {
35- // query = User.where{}
36- // }
37- // users = query.list(params)
38- // totalCount = query.count()
39- // }
21+ if (groupId) {
22+ def sort = params. sort ? (" user." + params. sort) : " user.fullName"
23+ users = UserRoleGroup . createCriteria(). list(max : params. max, offset : params. offset, sort : sort, order : params. order) {
24+ eq(" roleGroup.id" , groupId)
25+ }. collect { it. user }
26+
27+ totalCount = UserRoleGroup . where { roleGroup. id == groupId }. count()
28+ } else {
29+ def query
30+ if (affiliationId) {
31+ query = User . where { affiliation. id == affiliationId }
32+ } else if (isEnabled != null && isEnabled != " " ) {
33+ query = User . where { enabled == isEnabled }
34+ } else {
35+ query = User . where{}
36+ }
37+ users = query. list(params)
38+ totalCount = query. count()
39+ }
4040
4141 [users : users,
4242 totalCount : totalCount,
0 commit comments