...
|
...
|
@@ -104,10 +104,10 @@ func GetAuditTemplateByTypeId(chanceTypeId int) (v []*AuditTemplate, err error) |
|
|
return
|
|
|
}
|
|
|
|
|
|
func GetAuditTemplateByCode(companyId int64, code string) (v *ChanceType, err error) {
|
|
|
func GetAuditTemplateByCode(companyId int64, code string, chanceTypeId int) (v *ChanceType, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := "select * from audit_template where binary code=? and company_id=?"
|
|
|
if err = o.Raw(sql, code, companyId).QueryRow(&v); err == nil {
|
|
|
sql := "select * from audit_template where binary code=? and company_id=? and chance_type_id=?"
|
|
|
if err = o.Raw(sql, code, companyId, chanceTypeId).QueryRow(&v); err == nil {
|
|
|
return
|
|
|
}
|
|
|
return
|
...
|
...
|
|