|
@@ -53,24 +53,28 @@ func (this *SmartReportController) Detail() {
|
|
|
resp.Report = models.FormatSmartReport2Item(item)
|
|
|
if resp.Report.HeadResourceId > 0 {
|
|
|
headResource, err := models.GetResourceItemById(resp.Report.HeadResourceId)
|
|
|
- if err != nil {
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
br.Msg = "操作失败"
|
|
|
- br.ErrMsg = "获取资源库版头失败, Err: " + e.Error()
|
|
|
+ br.ErrMsg = "获取资源库版头失败, Err: " + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- resp.Report.HeadImg = headResource.ImgUrl
|
|
|
- resp.Report.HeadStyle = headResource.Style
|
|
|
+ if headResource != nil && headResource.ResourceId > 0 {
|
|
|
+ resp.Report.HeadImg = headResource.ImgUrl
|
|
|
+ resp.Report.HeadStyle = headResource.Style
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if resp.Report.EndResourceId > 0 {
|
|
|
endResource, err := models.GetResourceItemById(resp.Report.EndResourceId)
|
|
|
- if err != nil {
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
br.Msg = "操作失败"
|
|
|
- br.ErrMsg = "获取资源库版头失败, Err: " + e.Error()
|
|
|
+ br.ErrMsg = "获取资源库版尾失败, Err: " + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- resp.Report.EndImg = endResource.ImgUrl
|
|
|
- resp.Report.EndStyle = endResource.Style
|
|
|
+ if endResource != nil && endResource.ResourceId > 0 {
|
|
|
+ resp.Report.EndImg = endResource.ImgUrl
|
|
|
+ resp.Report.EndStyle = endResource.Style
|
|
|
+ }
|
|
|
}
|
|
|
// 免责声明
|
|
|
conf, e := models.GetBusinessConf()
|