作者 yangfu

模板列表修改

... ... @@ -96,9 +96,13 @@ 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).OrderBy("sort_num").All(&v)
//_, err = o.QueryTable(&AuditTemplate{}).
// Filter("chance_type_id", chanceTypeId).OrderBy("sort_num").All(&v)
sql := `select id,company_id,chance_type_id,name,doc,icon,code,sort_num,visible_type,visible_object,enable_status
from audit_template where chance_type_id=? order by sort_num`
if _, err = o.Raw(sql, chanceTypeId).QueryRows(&v); err == nil {
return
}
if err == orm.ErrNoRows {
return v, nil
}
... ...