作者 yangfu

模板排序修改

... ... @@ -96,7 +96,7 @@ func DeleteAuditTemplate(id int64) (err error) {
func GetAuditTemplateByTypeId(chanceTypeId int) (v []*AuditTemplate, err error) {
o := orm.NewOrm()
_, err = o.QueryTable(&AuditTemplate{}).
Filter("chance_type_id", chanceTypeId).All(&v)
Filter("chance_type_id", chanceTypeId).OrderBy("sort_num").All(&v)
if err == orm.ErrNoRows {
return v, nil
... ...
... ... @@ -86,7 +86,7 @@ func GetChanceTypeAll() (v []*ChanceType, err error) {
func GetChanceTypeByCompany(companyId int) (v []*ChanceType, err error) {
o := orm.NewOrm()
sql := "select * from chance_type where company_id=?"
sql := "select * from chance_type where company_id=? order by sort_num"
if _, err = o.Raw(sql, companyId).QueryRows(&v); err == nil {
return
}
... ...