fix: add deleted user status filter (#5464)

This commit is contained in:
Seefs
2026-06-13 00:03:28 +08:00
committed by GitHub
parent 1292b8b2d5
commit 1507229238
5 changed files with 18 additions and 6 deletions
+5 -1
View File
@@ -264,7 +264,11 @@ func SearchUsers(keyword string, group string, role *int, status *int, startIdx
query = query.Where("role = ?", *role)
}
if status != nil {
query = query.Where("status = ?", *status)
if *status == -1 {
query = query.Where("deleted_at IS NOT NULL")
} else {
query = query.Where("deleted_at IS NULL").Where("status = ?", *status)
}
}
// 获取总数