|
@@ -508,7 +508,7 @@ func (this *MobileReportController) List() {
|
|
var total int
|
|
var total int
|
|
resp := new(models.TacticsListResp)
|
|
resp := new(models.TacticsListResp)
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
- list := make([]*models.HomeArticle, 0)
|
|
|
|
|
|
+ list := make([]*models.ArticleListResp, 0)
|
|
|
|
|
|
if categoryId == utils.TIME_CATEGORYID {
|
|
if categoryId == utils.TIME_CATEGORYID {
|
|
var err error
|
|
var err error
|
|
@@ -567,17 +567,6 @@ func (this *MobileReportController) List() {
|
|
imgUrlChart = vslice[len(vslice)-1]
|
|
imgUrlChart = vslice[len(vslice)-1]
|
|
mapCategoryUrl[categoryIdStr] = imgUrlChart
|
|
mapCategoryUrl[categoryIdStr] = imgUrlChart
|
|
}
|
|
}
|
|
-
|
|
|
|
- //condition += ` AND category_id_two=? `
|
|
|
|
- //pars = append(pars, categoryId)
|
|
|
|
-
|
|
|
|
- //categoryIdSet, errCategory := models.GetdetailByCategoryIdSet(categoryId)
|
|
|
|
- //if errCategory != nil {
|
|
|
|
- // br.Msg = "获取信息失败"
|
|
|
|
- // br.ErrMsg = "获取信息失败,Err:" + errCategory.Error() + "categoryID 不存在:" + strconv.Itoa(categoryId)
|
|
|
|
- // return
|
|
|
|
- //}
|
|
|
|
- //fmt.Println(detail.PolymerizationId)
|
|
|
|
if detail.CeLueFieldId != "" {
|
|
if detail.CeLueFieldId != "" {
|
|
condition = ` AND ce_lue_field_id IN(` + detail.CeLueFieldId + `)`
|
|
condition = ` AND ce_lue_field_id IN(` + detail.CeLueFieldId + `)`
|
|
} else if detail.PolymerizationId != "" {
|
|
} else if detail.PolymerizationId != "" {
|
|
@@ -618,7 +607,7 @@ func (this *MobileReportController) List() {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
- list, err = models.GetHomeList(condition, pars, startSize, pageSize)
|
|
|
|
|
|
+ list, err = models.GetHomeListNew(condition, pars, startSize, pageSize)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取信息失败"
|
|
br.Msg = "获取信息失败"
|
|
br.Msg = "获取帖子数据失败,Err:" + err.Error()
|
|
br.Msg = "获取帖子数据失败,Err:" + err.Error()
|
|
@@ -647,23 +636,42 @@ func (this *MobileReportController) List() {
|
|
}
|
|
}
|
|
resp.CategoryImgUrlPc = mapChartPermission[detail.ChartPermissionName]
|
|
resp.CategoryImgUrlPc = mapChartPermission[detail.ChartPermissionName]
|
|
}
|
|
}
|
|
- lenList := len(list)
|
|
|
|
- for i := 0; i < lenList; i++ {
|
|
|
|
- item := list[i]
|
|
|
|
- list[i].Body = ""
|
|
|
|
- list[i].Abstract, _ = services.GetReportContentTextSub(item.Abstract)
|
|
|
|
- list[i].Annotation, _ = services.GetReportContentTextSub(item.Annotation)
|
|
|
|
- list[i].PublishDate = utils.StrTimeToTime(item.PublishDate).Format(utils.FormatDate) //时间字符串格式转时间格式
|
|
|
|
- //行业比较研究、资金流向,显示报告的摘要
|
|
|
|
- if resp.MatchTypeName == "行业比较研究" || resp.MatchTypeName == "资金流向" {
|
|
|
|
- list[i].Annotation = list[i].Abstract
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ listPublic, err := services.HandleArticleCategoryImg(list, user)
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "获取失败"
|
|
|
|
+ br.ErrMsg = "获取报告封面图片失败, Err:" + err.Error()
|
|
|
|
+ return
|
|
}
|
|
}
|
|
- if len(list) == 0 {
|
|
|
|
- list = make([]*models.HomeArticle, 0)
|
|
|
|
|
|
+ listResp := make([]*models.HomeArticle, 0)
|
|
|
|
+ //listResp :=
|
|
|
|
+ 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,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ //lenList := len(list)
|
|
|
|
+ //for i := 0; i < lenList; i++ {
|
|
|
|
+ // item := list[i]
|
|
|
|
+ // list[i].Body = ""
|
|
|
|
+ // list[i].Abstract, _ = services.GetReportContentTextSub(item.Abstract)
|
|
|
|
+ // list[i].Annotation, _ = services.GetReportContentTextSub(item.Annotation)
|
|
|
|
+ // list[i].PublishDate = utils.StrTimeToTime(item.PublishDate).Format(utils.FormatDate) //时间字符串格式转时间格式
|
|
|
|
+ // //行业比较研究、资金流向,显示报告的摘要
|
|
|
|
+ // if resp.MatchTypeName == "行业比较研究" || resp.MatchTypeName == "资金流向" {
|
|
|
|
+ // list[i].Annotation = list[i].Abstract
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
|
|
+ if len(listResp) == 0 {
|
|
|
|
+ listResp = make([]*models.HomeArticle, 0)
|
|
}
|
|
}
|
|
page = paging.GetPaging(currentIndex, pageSize, total)
|
|
page = paging.GetPaging(currentIndex, pageSize, total)
|
|
- resp.List = list
|
|
|
|
|
|
+ resp.List = listResp
|
|
resp.Paging = page
|
|
resp.Paging = page
|
|
br.Ret = 200
|
|
br.Ret = 200
|
|
br.Success = true
|
|
br.Success = true
|