|
@@ -544,14 +544,22 @@ func (this *ReportController) List() {
|
|
|
imgUrlChart = vslice[len(vslice)-1]
|
|
|
mapCategoryUrl[categoryIdStr] = imgUrlChart
|
|
|
}
|
|
|
+ var articleIds []int
|
|
|
lenList := len(list)
|
|
|
for i := 0; i < lenList; i++ {
|
|
|
item := list[i]
|
|
|
list[i].Body, _ = services.GetReportContentTextSub(item.Body)
|
|
|
//list[i].Abstract = html.UnescapeString(item.Abstract)
|
|
|
list[i].Abstract, _ = services.GetReportContentTextSub(item.Abstract)
|
|
|
+
|
|
|
+ if item.Resource == 1 {
|
|
|
+ articleIds = append(articleIds, item.ArticleId)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ articleMapPv := services.GetArticleHistoryByArticleId(articleIds) //文章Pv
|
|
|
+ articleCollectMap, _ := services.GetCygxArticleCollectMap(user.UserId) //用户收藏的文章
|
|
|
+ articleCollectNumMap, _ := services.GetCygxArticleCollectNumMapByArtcileIds(articleIds) //文章收藏的数量
|
|
|
for k, v := range list {
|
|
|
if v.Readnum == 0 && user.CreatedTime.Before(utils.StrTimeToTime(v.PublishDate)) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(v.PublishDate)) {
|
|
|
list[k].IsRed = true
|
|
@@ -560,6 +568,12 @@ func (this *ReportController) List() {
|
|
|
list[k].IsHaveVideo = true
|
|
|
}
|
|
|
list[k].ImgUrlPc = mapCategoryUrl[v.CategoryId]
|
|
|
+
|
|
|
+ if v.Resource == 1 {
|
|
|
+ v.Pv = articleMapPv[v.ArticleId]
|
|
|
+ v.IsCollect = articleCollectMap[v.ArticleId]
|
|
|
+ v.CollectNum = articleCollectNumMap[v.ArticleId]
|
|
|
+ }
|
|
|
if v.Resource == 2 {
|
|
|
v.PublishDate = utils.TimeRemoveHms2(v.PublishDate)
|
|
|
}
|