mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
fix: find memo list order (#1149)
This commit is contained in:
@@ -302,11 +302,11 @@ func findMemoRawList(ctx context.Context, tx *sql.Tx, find *api.MemoFind) ([]*me
|
||||
memo.row_status,
|
||||
memo.content,
|
||||
memo.visibility,
|
||||
memo_organizer.pinned
|
||||
IFNULL(memo_organizer.pinned, 0) AS pinned
|
||||
FROM memo
|
||||
LEFT JOIN memo_organizer ON memo_organizer.memo_id = memo.id
|
||||
LEFT JOIN memo_organizer ON memo_organizer.memo_id = memo.id AND memo_organizer.user_id = memo.creator_id
|
||||
WHERE ` + strings.Join(where, " AND ") + `
|
||||
ORDER BY memo_organizer.pinned DESC, memo.created_ts DESC
|
||||
ORDER BY pinned DESC, memo.created_ts DESC
|
||||
`
|
||||
if find.Limit != nil {
|
||||
query = fmt.Sprintf("%s LIMIT %d", query, *find.Limit)
|
||||
|
Reference in New Issue
Block a user