作者 yangfu

获取模板列表修改

@@ -239,7 +239,6 @@ func CheckUuid(ctx *context.Context) (result bool) { @@ -239,7 +239,6 @@ func CheckUuid(ctx *context.Context) (result bool) {
239 //AllowOption 允许跨域请求 239 //AllowOption 允许跨域请求
240 var AllowOption = func(ctx *context.Context) { 240 var AllowOption = func(ctx *context.Context) {
241 if ctx.Request.Method != "OPTIONS" { 241 if ctx.Request.Method != "OPTIONS" {
242 - log.Debug(fmt.Sprintf("receive:%v method:%v", ctx.Request.RequestURI, ctx.Request.Method))  
243 return 242 return
244 } 243 }
245 f := cors.Allow(&cors.Options{ 244 f := cors.Allow(&cors.Options{
@@ -86,7 +86,7 @@ func main() { @@ -86,7 +86,7 @@ func main() {
86 log.Info("app on start!") 86 log.Info("app on start!")
87 log.Info("Beego Run Mode:", beego.BConfig.RunMode) 87 log.Info("Beego Run Mode:", beego.BConfig.RunMode)
88 88
89 - StaticFileAllowCors() 89 + //StaticFileAllowCors()
90 90
91 beego.InsertFilter("file/opp/*", beego.BeforeStatic, FilterBeforeStatic) 91 beego.InsertFilter("file/opp/*", beego.BeforeStatic, FilterBeforeStatic)
92 92
@@ -88,7 +88,8 @@ func DeleteAuditTemplate(id int64) (err error) { @@ -88,7 +88,8 @@ func DeleteAuditTemplate(id int64) (err error) {
88 //获取审核模板列表 88 //获取审核模板列表
89 func GetAuditTemplates(companyId int64, chanceTypeId int) (v []*AuditTemplate, err error) { 89 func GetAuditTemplates(companyId int64, chanceTypeId int) (v []*AuditTemplate, err error) {
90 o := orm.NewOrm() 90 o := orm.NewOrm()
91 - sql := "select * from audit_template where company_id=? and chance_type_id=? and enable_status=1 order by sort_num" 91 + sql := "select id,company_id,chance_type_id,`name`,doc,icon,code,sort_num,visible_type,visible_object,LEFT(example,5) example,videos " +
  92 + " from audit_template where company_id=? and chance_type_id=? and enable_status=1 order by sort_num"
92 if _, err = o.Raw(sql, companyId, chanceTypeId).QueryRows(&v); err == nil { 93 if _, err = o.Raw(sql, companyId, chanceTypeId).QueryRows(&v); err == nil {
93 return 94 return
94 } 95 }