feat: update search memo filter

This commit is contained in:
Steven
2024-05-27 23:25:25 +08:00
parent ba0876a563
commit f0e5a72271
11 changed files with 216 additions and 77 deletions

View File

@ -84,6 +84,15 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo
if v.Tag != nil {
where, args = append(where, "memo.payload->'property'->'tags' @> "+placeholder(len(args)+1)), append(args, fmt.Sprintf(`["%s"]`, *v.Tag))
}
if v.HasLink {
where = append(where, "(memo.payload->'property'->>'hasLink')::BOOLEAN IS TRUE")
}
if v.HasTaskList {
where = append(where, "(memo.payload->'property'->>'hasTaskList')::BOOLEAN IS TRUE")
}
if v.HasCode {
where = append(where, "(memo.payload->'property'->>'hasCode')::BOOLEAN IS TRUE")
}
}
if find.ExcludeComments {
where = append(where, "memo_relation.related_memo_id IS NULL")