xingzai 1 an în urmă
părinte
comite
1ee4fdfef9
2 a modificat fișierele cu 4 adăugiri și 60 ștergeri
  1. 2 38
      services/es_comprehensive.go
  2. 2 22
      services/resource_data.go

+ 2 - 38
services/es_comprehensive.go

@@ -558,10 +558,11 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
 			err = errors.New("GetYanxuanSpecialList, Err: " + e.Error())
 			return
 		}
-
+		yanxuanSpecialPv := GetYanxuanSpecialRecordByYanxuanSpecialId(yanxuanSpecialIds) // 专栏Pv
 		for _, v := range listyanxuanSpecial {
 			v.PublishTime = utils.TimeRemoveHms2(v.PublishTime)
 			v.Annotation, _ = GetReportContentTextSubNew(v.Content)
+			v.Pv = yanxuanSpecialPv[v.Id]
 			if len(yanXuanbodyHighlight[v.Id]) > 0 {
 				v.BodyHighlight = yanXuanbodyHighlight[v.Id]
 			} else {
@@ -579,43 +580,6 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
 			if v.Article == nil && v.Newchart == nil && v.Roadshow == nil && v.Activity == nil && v.Activityvideo == nil && v.Activityvoice == nil && v.Activityspecial == nil && v.Researchsummary == nil && v.Minutessummary == nil && v.Meetingreviewchapt == nil && v.ProductInterior == nil && v.IndustrialResource == nil && v.YanxuanSpecial == nil && v.AskserieVideo == nil && v.ReportSelection == nil {
 				continue
 			}
-			//if v.Article != nil && v.SourceId == vList.SourceId {
-			//	v.Article.Title = vList.Title
-			//}
-			//if v.Newchart != nil && v.SourceId == vList.SourceId {
-			//	v.Newchart.Title = vList.Title
-			//}
-			//if v.Roadshow != nil && v.SourceId == vList.SourceId {
-			//	v.Roadshow.Title = vList.Title
-			//}
-			//if v.Activity != nil && v.SourceId == vList.SourceId {
-			//	v.Activity.ActivityName = vList.Title
-			//}
-			//if v.Activityvideo != nil && v.SourceId == vList.SourceId {
-			//	v.Activityvideo.Title = vList.Title
-			//}
-			//if v.Activityvoice != nil && v.SourceId == vList.SourceId {
-			//	v.Activityvoice.Title = vList.Title
-			//}
-			//
-			//if v.Activityspecial != nil && v.SourceId == vList.SourceId {
-			//	v.Activityspecial.ResearchTheme = vList.Title
-			//}
-			//if v.Researchsummary != nil && v.SourceId == vList.SourceId {
-			//	v.Researchsummary.Title = vList.Title
-			//}
-			//if v.Minutessummary != nil && v.SourceId == vList.SourceId {
-			//	v.Minutessummary.Title = vList.Title
-			//}
-			//if v.ProductInterior != nil && v.SourceId == vList.SourceId {
-			//	v.ProductInterior.Title = vList.Title
-			//}
-			//if v.IndustrialResource != nil && v.SourceId == vList.SourceId && v.Source == vList.Source {
-			//	v.IndustrialResource.UpdateTime = strings.Replace(vList.PublishDate, "00:00:00", "", -1)
-			//}
-			//if v.YanxuanSpecial != nil && v.SourceId == vList.SourceId {
-			//	v.YanxuanSpecial.Title = vList.Title
-			//}
 			if v.SourceId == vList.SourceId && v.Source == vList.Source {
 				items = append(items, v)
 			}

+ 2 - 22
services/resource_data.go

@@ -265,27 +265,6 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 		}
 	}
 
-	//处理报告精选
-	lenreportselectionIds := len(reportselectionIds)
-	if lenreportselectionIds > 0 {
-		pars = make([]interface{}, 0)
-		condition = ` AND article_id IN (` + utils.GetOrmInReplace(lenreportselectionIds) + `)`
-		pars = append(pars, reportselectionIds)
-		listreportselection, e := models.GetReportSelectionList(condition, pars, 0, lenreportselectionIds)
-		if e != nil {
-			err = errors.New("GetReportSelectionList, Err: " + e.Error())
-			return
-		}
-		mapPv := GetCygxReportHistoryRecordListMap(reportselectionIds, "bgjx")
-		for _, v := range listreportselection {
-			v.Title += "(第" + v.Periods + "期)"
-			v.MarketStrategy = AnnotationHtml(v.MarketStrategy)
-			v.PublishDate = utils.TimeRemoveHms2(v.PublishDate)
-			v.Pv = mapPv[v.ArticleId]
-			mapItems[fmt.Sprint("reportselection", v.ArticleId)].ReportSelection = v
-		}
-	}
-
 	//处理研选专栏
 	lenyanxuanSpecialIds := len(yanxuanSpecialIds)
 	if lenyanxuanSpecialIds > 0 {
@@ -297,10 +276,11 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 			err = errors.New("GetYanxuanSpecialList, Err: " + e.Error())
 			return
 		}
-
+		yanxuanSpecialPv := GetYanxuanSpecialRecordByYanxuanSpecialId(yanxuanSpecialIds) // 专栏Pv
 		for _, v := range listyanxuanSpecial {
 			v.PublishTime = utils.TimeRemoveHms2(v.PublishTime)
 			v.Annotation, _ = GetReportContentTextSubNew(v.Content)
+			v.Pv = yanxuanSpecialPv[v.Id]
 			v.LabelKeywordImgLink = utils.LABEL_ICO_4
 			mapItems[fmt.Sprint(utils.CYGX_OBJ_YANXUANSPECIAL, v.Id)].YanxuanSpecial = v
 		}