Fix sorting admin user list by last login (#22081) (#22106)

Backport of  #22081

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
This commit is contained in:
aceArt-GmbHandKN4CK3R authored and GitHub committed 2022-12-13 09:18:20 +08:00
1 parent a8534ac4a4
commit c057590a3a
2 files changed
+6 -2

No files matched your search

+4
View File
@@ -58,6 +58,10 @@ func RenderUserSearch(ctx *context.Context, opts *user_model.SearchUserOptions,
orderBy = "`user`.updated_unix ASC"
case "reversealphabetically":
orderBy = "`user`.name DESC"
case "lastlogin":
orderBy = "`user`.last_login_unix ASC"
case "reverselastlogin":
orderBy = "`user`.last_login_unix DESC"
case UserSearchDefaultSortType: // "alphabetically"
default:
orderBy = "`user`.name ASC"