Although #17124 fixed the same issue for the feed, some other parts
with the same issue were found.
Co-authored-by: finga <finga@onders.org>
notices := make([]*Notice, 0, pageSize)
return notices, db.GetEngine(db.DefaultContext).
Limit(pageSize, (page-1)*pageSize).
- Desc("id").
+ Desc("created_unix").
Find(¬ices)
}
func (issue *Issue) GetLastComment() (*Comment, error) {
var c Comment
exist, err := db.GetEngine(db.DefaultContext).Where("type = ?", CommentTypeComment).
- And("issue_id = ?", issue.ID).Desc("id").Get(&c)
+ And("issue_id = ?", issue.ID).Desc("created_unix").Get(&c)
if err != nil {
return nil, err
}
sess = sess.Where("name=?", opts.Name)
}
- sess = sess.Desc("id")
+ sess = sess.Desc("created_unix")
if opts.Page != 0 {
sess = db.SetSessionPagination(sess, &opts)