|
@@ -147,16 +147,18 @@ func (this *ReportController) ListReport() {
|
|
|
pvMap := make(map[int]int, 0)
|
|
|
uvMap := make(map[int]int, 0)
|
|
|
if len(syncReportIdArr) > 0 {
|
|
|
- puvList, e := models.GetPUVByResearchReportIds(syncReportIdArr)
|
|
|
- if e != nil {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取同步报告对应的PV、UV失败, Err: " + e.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- puvLen := len(puvList)
|
|
|
- for i := 0; i < puvLen; i++ {
|
|
|
- pvMap[puvList[i].ResearchReportId] = puvList[i].Pv
|
|
|
- uvMap[puvList[i].ResearchReportId] = puvList[i].Uv
|
|
|
+ if utils.BusinessCode == utils.BusinessCodeRelease || utils.BusinessCode == utils.BusinessCodeSandbox {
|
|
|
+ puvList, e := models.GetPUVByResearchReportIds(syncReportIdArr)
|
|
|
+ if e != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取同步报告对应的PV、UV失败, Err: " + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ puvLen := len(puvList)
|
|
|
+ for i := 0; i < puvLen; i++ {
|
|
|
+ pvMap[puvList[i].ResearchReportId] = puvList[i].Pv
|
|
|
+ uvMap[puvList[i].ResearchReportId] = puvList[i].Uv
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
// 晨周报音频列表
|
|
@@ -688,11 +690,14 @@ func (this *ReportController) Detail() {
|
|
|
if len(tmpChapterList) > 0 {
|
|
|
// 获取更新规则
|
|
|
researchType := tmpChapterList[0].ReportType
|
|
|
- chapterTypeList, tmpErr := models.GetAllReportChapterTypeListByResearchType(researchType)
|
|
|
- if tmpErr != nil {
|
|
|
- br.Msg = "获取更新规则失败"
|
|
|
- br.ErrMsg = "获取更新规则失败, Err: " + tmpErr.Error()
|
|
|
- return
|
|
|
+ chapterTypeList := make([]*models.ReportChapterType, 0)
|
|
|
+ if utils.BusinessCode == utils.BusinessCodeRelease || utils.BusinessCode == utils.BusinessCodeSandbox {
|
|
|
+ chapterTypeList, err = models.GetAllReportChapterTypeListByResearchType(researchType)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取更新规则失败"
|
|
|
+ br.ErrMsg = "获取更新规则失败, Err: " + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
// 调整章节更新
|
|
|
nowTime := time.Now().Local()
|
|
@@ -1357,11 +1362,14 @@ func (this *ReportController) GetReportChapterList() {
|
|
|
if len(chapterList) > 0 {
|
|
|
// 获取更新规则
|
|
|
researchType := chapterList[0].ReportType
|
|
|
- chapterTypeList, tmpErr := models.GetAllReportChapterTypeListByResearchType(researchType)
|
|
|
- if tmpErr != nil {
|
|
|
- br.Msg = "获取更新规则失败"
|
|
|
- br.ErrMsg = "获取更新规则失败, Err: " + tmpErr.Error()
|
|
|
- return
|
|
|
+ chapterTypeList := make([]*models.ReportChapterType, 0)
|
|
|
+ if utils.BusinessCode == utils.BusinessCodeRelease || utils.BusinessCode == utils.BusinessCodeSandbox {
|
|
|
+ chapterTypeList, err = models.GetAllReportChapterTypeListByResearchType(researchType)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取更新规则失败"
|
|
|
+ br.ErrMsg = "获取更新规则失败, Err: " + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
// 调整章节更新
|
|
|
nowTime := time.Now().Local()
|