This commit is contained in:
xing 2024-01-04 23:36:00 +08:00
parent 4d9d011213
commit 8fcf3ecca2

View File

@ -50,9 +50,6 @@ func (c CommentHandle) findComments(ctx context.Context, timeout time.Duration,
return t, len(t) > 0 return t, len(t) > 0
}) })
if len(rr) < 1 { if len(rr) < 1 {
slice.Sort(comments, func(i, j models.Comments) bool {
return c.html.FloorOrder(c.order, i, j)
})
return comments, nil return comments, nil
} }
ids := slice.Decompress(rr) ids := slice.Decompress(rr)
@ -65,6 +62,9 @@ func (c CommentHandle) findComments(ctx context.Context, timeout time.Duration,
return nil, err return nil, err
} }
comments = append(comments, rrr...) comments = append(comments, rrr...)
slice.Sort(comments, func(i, j models.Comments) bool {
return c.html.FloorOrder(c.order, i, j)
})
return comments, nil return comments, nil
} }