Kaynağa Gözat

调整首页报告汇总

xiexiaoyuan 3 yıl önce
ebeveyn
işleme
618a0b1d74
2 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 3 0
      services/report/classify.go
  2. 3 1
      services/report/report.go

+ 3 - 0
services/report/classify.go

@@ -254,6 +254,9 @@ func GetClassifySecondSimpleList(user user.UserInfo, classifyIdFirst int) (list
 
 	if len(simpleList) > 0 {
 		for _, item := range simpleList {
+			if item.ClassifyName == classifyParent.ClassifyName && len(simpleList) == 1 {
+				break
+			}
 			temp := new(response.ClassifySimpleListItem)
 			temp.ClassifyIdSecond = item.Id
 			temp.ClassifyNameSecond = item.ClassifyName

+ 3 - 1
services/report/report.go

@@ -144,6 +144,7 @@ func GetLatestClassReport(permissionIds []int, userId uint64) (purchaseList []*p
 				}
 				temp.Unread = unReadItem["大事点评"] + unReadItem["会议纪要"] + unReadItem["年报合集"]
 				temp.Content = fmt.Sprintf("【第%d期|FICC】%s", temp.Stage, temp.ClassifyNameFirst)
+				temp.ImgUrl = "https://hzstatic.hzinsights.com/static/yb_wx/purchase_icon_other.png"
 				otherLatestItem = temp
 			}
 		}
@@ -816,7 +817,7 @@ func GetCollectReportList(user user.UserInfo, chartPermissionId, pageIndex, page
 		}
 		listMap := make(map[string]*response.ReportCollectList)
 		for _, v := range reportList {
-			v.ContentSub = html.UnescapeString(v.ContentSub)
+			v.ContentSub = "<div style=\"-webkit-line-clamp: 3;-webkit-box-orient: vertical;display: -webkit-box;overflow: hidden;text-overflow: ellipsis;\">"+html.UnescapeString(v.ContentSub)+"</div>"
 			if _, ok := listMap[v.PublishTime.Format("2006-01-02")]; !ok {
 				temp := new(response.ReportCollectList)
 				temp.Date = v.PublishTime.Format("2006-01-02")
@@ -914,6 +915,7 @@ func SearchReport(user user.UserInfo, keyWord string, pageIndex, pageSize int)(r
 					temp.ClassifyNameFirst = "<span style=\"color:#E3B377\">"+temp.ClassifyNameFirst+"</span>"
 				}
 			}
+			temp.ContentSub = "<div style=\"-webkit-line-clamp: 3;-webkit-box-orient: vertical;display: -webkit-box;overflow: hidden;text-overflow: ellipsis;\">"+temp.ContentSub+"</div>"
 			reportList = append(reportList, temp)
 		}
 	}