Merge pull request #1153 from hging/main

feat: add ungrouped filter to account
This commit is contained in:
Wesley Liddick
2026-03-19 21:55:28 +08:00
committed by GitHub
9 changed files with 47 additions and 4 deletions

View File

@@ -474,7 +474,9 @@ func (r *accountRepository) ListWithFilters(ctx context.Context, params paginati
if search != "" {
q = q.Where(dbaccount.NameContainsFold(search))
}
if groupID > 0 {
if groupID == service.AccountListGroupUngrouped {
q = q.Where(dbaccount.Not(dbaccount.HasAccountGroups()))
} else if groupID > 0 {
q = q.Where(dbaccount.HasAccountGroupsWith(dbaccountgroup.GroupIDEQ(groupID)))
}