Browse Source

no message

xingzai 2 years ago
parent
commit
d64afa4398
1 changed files with 22 additions and 7 deletions
  1. 22 7
      controllers/research.go

+ 22 - 7
controllers/research.go

@@ -219,11 +219,26 @@ func (this *MobileResearchController) KolList() {
 		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
 		return
 	}
+	mapHot := make(map[int]bool)
+	if themeType == 2 {
+		conditionHot := `ORDER BY sum_num DESC `
+		listhot, err := models.GetDepartmentList(condition, conditionHot, user.UserId, 0, 3)
+		if err != nil {
+			br.Msg = "获取信息失败"
+			br.ErrMsg = "获取信息失败,Err:" + err.Error()
+			return
+		}
+		for _, v := range listhot {
+			mapHot[v.DepartmentId] = true
+		}
+	}
+
 	departmentMap := make(map[string]string)
 	for k, v := range list {
 		if v.FllowNum > 0 {
 			list[k].IsFollow = true
 		}
+		list[k].IsHot = mapHot[v.DepartmentId]
 		list[k].PublishDate = utils.StrTimeToTime(v.PublishDate).Format(utils.FormatDate) //时间字符串格式转时间格式
 		for _, v2 := range listIndustrial {
 			if v2.DepartmentId == v.DepartmentId {
@@ -319,14 +334,14 @@ func (this *MobileResearchController) HotList() {
 		br.ErrMsg = "GetYanXuanIndustrialManagementIdNewMap,Err:" + err.Error()
 		return
 	}
-	//if themeType == 2 {
-	mapHot, err = services.GetYanXuanIndustrialManagementIdHotMap(articleTypeIds)
-	if err != nil {
-		br.Msg = "获取信息失败"
-		br.ErrMsg = "GetYanXuanIndustrialManagementIdNewMap,Err:" + err.Error()
-		return
+	if themeType == 2 {
+		mapHot, err = services.GetYanXuanIndustrialManagementIdHotMap(articleTypeIds)
+		if err != nil {
+			br.Msg = "获取信息失败"
+			br.ErrMsg = "GetYanXuanIndustrialManagementIdNewMap,Err:" + err.Error()
+			return
+		}
 	}
-	//}
 	for k, v := range list {
 		list[k].IsNew = mapNew[v.IndustrialManagementId]
 		list[k].IsHot = mapHot[v.IndustrialManagementId]