作者 yangfu

获取模板列表修改

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