Skip to content

Commit

Permalink
optimize: 服务导入模板时选择的模版版本按创建时间逆向排序 (#2702)
Browse files Browse the repository at this point in the history
  • Loading branch information
fireyun authored Oct 25, 2023
1 parent ee76f06 commit b07f44a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bcs-services/bcs-bscp/pkg/dal/dao/template_revision.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,15 @@ func (dao *templateRevisionDao) ListByTemplateIDs(kit *kit.Kit, bizID uint32, te
[]*table.TemplateRevision, error) {
m := dao.genQ.TemplateRevision
q := dao.genQ.TemplateRevision.WithContext(kit.Ctx)
return q.Where(m.BizID.Eq(bizID), m.TemplateID.In(templateIDs...)).Find()
return q.Where(m.BizID.Eq(bizID), m.TemplateID.In(templateIDs...)).Order(m.ID.Desc()).Find()
}

// ListByTemplateIDsWithTx list template revisions by template ids with transaction.
func (dao *templateRevisionDao) ListByTemplateIDsWithTx(
kit *kit.Kit, tx *gen.QueryTx, bizID uint32, templateIDs []uint32) ([]*table.TemplateRevision, error) {
m := tx.TemplateRevision
q := tx.TemplateRevision.WithContext(kit.Ctx)
return q.Where(m.BizID.Eq(bizID), m.TemplateID.In(templateIDs...)).Find()
return q.Where(m.BizID.Eq(bizID), m.TemplateID.In(templateIDs...)).Order(m.ID.Desc()).Find()
}

// DeleteForTmplWithTx delete template revision for one template with transaction.
Expand Down

0 comments on commit b07f44a

Please sign in to comment.