xingzai 2 ani în urmă
părinte
comite
a57eb4760d
3 a modificat fișierele cu 22 adăugiri și 12 ștergeri
  1. 5 1
      controllers/home.go
  2. 2 0
      services/activity.go
  3. 15 11
      services/article.go

+ 5 - 1
controllers/home.go

@@ -690,7 +690,7 @@ func (this *HomeController) NewList() {
 	if user.CompanyId <= 1 {
 		condition += " AND source IN ('roadshow','article') "
 		startSize = 0
-		pageSize = utils.PageSize5
+		pageSize = 4
 	} else {
 		condition += ` AND source NOT IN ('activity','activityspecial','newchart') ` + conditionInit
 		conditionActivity, err := services.GetActivityonditionList(user, "", "", "", "1,2,3", "", 0, 0, "", 0)
@@ -744,6 +744,10 @@ func (this *HomeController) NewList() {
 		return
 	}
 
+	if user.CompanyId <= 1 {
+		total = pageSize
+	}
+
 	page := paging.GetPaging(currentIndex, pageSize, total)
 	//Source      string    `description:"资源类型 报告 :article 、图表 :newchart、微路演 :roadshow、活动 :activity、活动视频:activityvideo、活动音频:activityvoice、专项调研活动:activityspecial"`
 	list, err := services.GetResourceDataList(condition, pars, startSize, pageSize, user)

+ 2 - 0
services/activity.go

@@ -1491,6 +1491,8 @@ func ActivityButtonShow(item *models.ActivityDetail) (articleDetail *models.Acti
 		return
 	}
 
+	articleDetail.Expert, _ = GetReportContentTextSub(item.Expert)
+
 	//专家电话会 1
 	if articleDetail.ActivityTypeId == 1 && articleDetail.IsLimitPeople == 0 && (articleDetail.ActiveState == "1" || articleDetail.ActiveState == "2") {
 		articleDetail.IsShowHelpSsk = true

+ 15 - 11
services/article.go

@@ -1804,7 +1804,7 @@ func ArticleAnnotation(item *models.HomeArticle) (annotation string) {
 	if item.Annotation != "" {
 		annotation = strings.Replace(item.Annotation, "<br>", "", -1)
 	} else {
-		annotation = item.Abstract
+		return
 	}
 
 	bodyText, _ := GetReportContentTextSubNew(annotation)
@@ -1831,19 +1831,23 @@ func ArticleAnnotation(item *models.HomeArticle) (annotation string) {
 			mapDoc[(strings.Index(docText, liText))] = strconv.Itoa(tk+1) + "." + liText
 			mapSort = append(mapSort, textLen)
 		})
-		//排序
-		sort.Ints(mapSort)
-		var annotationHtml string
-		for _, vSort := range mapSort {
-			for k, v := range mapDoc {
-				if k == vSort {
-					annotationHtml += v + "<br>"
+		if len(mapSort) == 0 {
+			return
+		} else {
+			//排序
+			sort.Ints(mapSort)
+			var annotationHtml string
+			for _, vSort := range mapSort {
+				for k, v := range mapDoc {
+					if k == vSort {
+						annotationHtml += v + "<br>"
+					}
 				}
 			}
+			annotationHtml = strings.TrimRight(annotationHtml, "<br>")
+			annotationHtml = "<p>" + annotationHtml + "</p>"
+			annotation = annotationHtml
 		}
-		annotationHtml = strings.TrimRight(annotationHtml, "<br>")
-		annotationHtml = "<p>" + annotationHtml + "</p>"
-		annotation = annotationHtml
 	}
 	return
 }