|
@@ -8,6 +8,8 @@ import (
|
|
|
"hongze/hongze_yb/models/response"
|
|
|
"hongze/hongze_yb/models/response/purchase"
|
|
|
"hongze/hongze_yb/models/tables/company_product"
|
|
|
+ "hongze/hongze_yb/models/tables/rddp/report"
|
|
|
+ "hongze/hongze_yb/models/tables/research_report"
|
|
|
"hongze/hongze_yb/models/tables/yb_activity"
|
|
|
"hongze/hongze_yb/models/tables/yb_activity_permission"
|
|
|
"hongze/hongze_yb/models/tables/yb_activity_register"
|
|
@@ -143,6 +145,31 @@ func GetActivityDetail(activityId, userId int) (detail *yb_activity.ActivityDeta
|
|
|
if registerErr != gorm.ErrRecordNotFound {
|
|
|
detail.RegisterState = 1
|
|
|
}
|
|
|
+ // 判断报告链接对应的报告发布状态,若为未发布则报告链接置空
|
|
|
+ if detail.ReportId > 0 && detail.ReportLink != "" {
|
|
|
+ if detail.IsNewReport == 1 {
|
|
|
+ // 去新报告表中查询
|
|
|
+ newReport, e := report.GetByReportId(detail.ReportId)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("获取新报告详情失败, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if newReport.State != 2 {
|
|
|
+ detail.ReportLink = ""
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 查询老报告表
|
|
|
+ oldReport, e := research_report.GetByResearchReportId(uint64(detail.ReportId))
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("获取老报告详情失败, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if oldReport.Status != "report" {
|
|
|
+ detail.ReportLink = ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return
|
|
|
}
|
|
|
|