作者 yangfu

fix

@@ -235,6 +235,10 @@ func Templates(header *protocol.RequestHeader, request *protocol.TemplatesReques @@ -235,6 +235,10 @@ func Templates(header *protocol.RequestHeader, request *protocol.TemplatesReques
235 if len(item.Example) > 0 || len(item.Videos) > 2 { 235 if len(item.Example) > 0 || len(item.Videos) > 2 {
236 template.Link = fmt.Sprintf("%v/#/ability/opportunity?id=%v", beego.AppConfig.String("h5_host"), item.Id) 236 template.Link = fmt.Sprintf("%v/#/ability/opportunity?id=%v", beego.AppConfig.String("h5_host"), item.Id)
237 } 237 }
  238 + if template.Questions, err = agg.GetCheckQuestionsByTemplateId(item.Id); err != nil {
  239 + log.Error(err)
  240 + return
  241 + }
238 for j := range forms { 242 for j := range forms {
239 form := forms[j] 243 form := forms[j]
240 template.FormList[j] = &protocol.Form{ 244 template.FormList[j] = &protocol.Form{
@@ -289,7 +293,7 @@ func Template(header *protocol.RequestHeader, request *protocol.TemplateRequest) @@ -289,7 +293,7 @@ func Template(header *protocol.RequestHeader, request *protocol.TemplateRequest)
289 Doc: item.Doc, 293 Doc: item.Doc,
290 FormList: make([]*protocol.Form, len(forms)), 294 FormList: make([]*protocol.Form, len(forms)),
291 } 295 }
292 - if len(item.Example) > 0 { 296 + if len(item.Example) > 0 || len(item.Videos) > 2 {
293 template.Link = fmt.Sprintf("%v/#/ability/opportunity?id=%v", beego.AppConfig.String("h5_host"), item.Id) 297 template.Link = fmt.Sprintf("%v/#/ability/opportunity?id=%v", beego.AppConfig.String("h5_host"), item.Id)
294 } 298 }
295 if template.Questions, err = agg.GetCheckQuestionsByTemplateId(templates.Id); err != nil { 299 if template.Questions, err = agg.GetCheckQuestionsByTemplateId(templates.Id); err != nil {