作者 tangxvhui

Merge branch 'test' of http://gitlab.fjmaimaimai.com/mmm-go/oppmg into test

... ... @@ -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
}
... ...