chore: implement search random memos

This commit is contained in:
Steven
2024-03-30 13:50:18 +08:00
parent 03c93785f4
commit bb10bb200c
5 changed files with 36 additions and 9 deletions

View File

@ -82,6 +82,9 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo
orders = append(orders, "created_ts DESC")
}
orders = append(orders, "id DESC")
if find.Random {
orders = append(orders, "RAND()")
}
fields := []string{
`memo.id AS id`,