|
@@ -2088,7 +2088,7 @@ func (this *MobileReportController) TacticsList() {
|
|
|
Abstract: v.Abstract,
|
|
|
Body: v.Body,
|
|
|
PublishDate: v.PublishDate,
|
|
|
- Resource: v.Resource,
|
|
|
+ Resource: 1,
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -2134,30 +2134,53 @@ func (this *MobileReportController) TacticsList() {
|
|
|
}
|
|
|
|
|
|
var articleIds []int
|
|
|
+ var productInteriorIs []int
|
|
|
|
|
|
for _, v := range listPublic {
|
|
|
if v.Resource == 1 {
|
|
|
articleIds = append(articleIds, v.ArticleId)
|
|
|
}
|
|
|
+ if v.Resource == 2 {
|
|
|
+ productInteriorIs = append(productInteriorIs, v.ArticleId)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
articleMapPv := services.GetArticleHistoryByArticleId(articleIds) //文章Pv
|
|
|
articleCollectMap, _ := services.GetCygxArticleCollectMap(user.UserId) //用户收藏的文章
|
|
|
articleCollectNumMap, _ := services.GetCygxArticleCollectNumMapByArtcileIds(articleIds) //文章收藏的数量
|
|
|
+
|
|
|
+ productInteriorMapPv := services.GetCygxProductInteriorHistoryListPvMap(productInteriorIs) //产品内测Pv
|
|
|
listResp := make([]*models.HomeArticle, 0)
|
|
|
for _, v := range listPublic {
|
|
|
- listResp = append(listResp, &models.HomeArticle{
|
|
|
- ArticleId: v.ArticleId,
|
|
|
- Title: v.Title,
|
|
|
- Annotation: "核心观点:" + v.Annotation,
|
|
|
- Abstract: v.Abstract,
|
|
|
- ImgUrlPc: v.ImgUrlPc,
|
|
|
- PublishDate: v.PublishDate,
|
|
|
- Resource: v.Resource,
|
|
|
- Pv: articleMapPv[v.ArticleId],
|
|
|
- IsCollect: articleCollectMap[v.ArticleId],
|
|
|
- CollectNum: articleCollectNumMap[v.ArticleId],
|
|
|
- })
|
|
|
+ item := new(models.HomeArticle)
|
|
|
+ item.ArticleId = v.ArticleId
|
|
|
+ item.Title = v.Title
|
|
|
+ item.Annotation = v.Annotation
|
|
|
+ item.Abstract = v.Abstract
|
|
|
+ item.ImgUrlPc = v.ImgUrlPc
|
|
|
+ item.PublishDate = v.PublishDate
|
|
|
+ item.Resource = v.Resource
|
|
|
+ if v.Resource == 1 {
|
|
|
+ item.Pv = articleMapPv[v.ArticleId]
|
|
|
+ item.IsCollect = articleCollectMap[v.ArticleId]
|
|
|
+ item.CollectNum = articleCollectNumMap[v.ArticleId]
|
|
|
+ }
|
|
|
+ if v.Resource == 2 {
|
|
|
+ item.Pv = productInteriorMapPv[v.ArticleId]
|
|
|
+ }
|
|
|
+ //listResp = append(listResp, &models.HomeArticle{
|
|
|
+ // ArticleId: v.ArticleId,
|
|
|
+ // Title: v.Title,
|
|
|
+ // Annotation: "核心观点:" + v.Annotation,
|
|
|
+ // Abstract: v.Abstract,
|
|
|
+ // ImgUrlPc: v.ImgUrlPc,
|
|
|
+ // PublishDate: v.PublishDate,
|
|
|
+ // Resource: v.Resource,
|
|
|
+ // Pv: articleMapPv[v.ArticleId],
|
|
|
+ // IsCollect: articleCollectMap[v.ArticleId],
|
|
|
+ // CollectNum: articleCollectNumMap[v.ArticleId],
|
|
|
+ //})
|
|
|
+ listResp = append(listResp, item)
|
|
|
}
|
|
|
if len(listResp) == 0 {
|
|
|
listResp = make([]*models.HomeArticle, 0)
|