Explorar o código

Merge branch 'cygx_need_929' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai hai 1 ano
pai
achega
1c938399ab
Modificáronse 2 ficheiros con 11 adicións e 3 borrados
  1. 9 1
      controllers/yanxuan_special.go
  2. 2 2
      models/cygx_yanxuan_special.go

+ 9 - 1
controllers/yanxuan_special.go

@@ -76,6 +76,14 @@ func (this *YanxuanSpecialController) List() {
 		br.ErrMsg = "获取失败, Err:" + err.Error()
 		return
 	}
+
+	var yanxuanSpecialIds []int
+	for _, v := range list {
+		yanxuanSpecialIds = append(yanxuanSpecialIds, v.Id)
+	}
+
+	pvMap := services.GetYanxuanSpecialRecordByYanxuanSpecialId(yanxuanSpecialIds)
+
 	for _, v := range list {
 		hasImg, err := utils.ArticleHasImgUrl(v.Content)
 		if err != nil {
@@ -114,6 +122,7 @@ func (this *YanxuanSpecialController) List() {
 			}
 			v.Tags += v.IndustryTags
 		}
+		v.Pv = pvMap[v.Id]
 	}
 
 	isAuthor, isImproveInformation := services.GetYanxuanSpecialAuthorInfo(sysUser) //用户是否没开通研选专栏以及,专栏信息是否完善
@@ -122,7 +131,6 @@ func (this *YanxuanSpecialController) List() {
 	resp.List = list
 	page := paging.GetPaging(currentIndex, pageSize, total)
 	resp.Paging = page
-
 	br.Data = resp
 	br.Ret = 200
 	br.Success = true

+ 2 - 2
models/cygx_yanxuan_special.go

@@ -102,8 +102,8 @@ type CygxYanxuanSpecialCenterResp struct {
 	Docs            []Doc
 	Annotation      string   `description:"核心观点"`
 	Source          string   `description:"来源"`
-	Pv              string   `description:"Pv"`
-	Uv              string   `description:"Uv"`
+	Pv              int      `description:"Pv"`
+	Uv              int      `description:"Uv"`
 	PublishDate     string   // 提审过审或驳回时间      string `description:"核心观点"`
 	BodyHighlight   []string `description:"搜索高亮展示结果"`
 }