|
@@ -553,3 +553,39 @@ func GetArticleTypeMap() (nameMapResp map[int]string, buttonStyleMapResp map[int
|
|
|
buttonStyleMapResp = buttonStyleMap
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// IndustrialManagementHotMapGropuPermission获取近一个月报告阅读数量最多的产业信息 根据行业分组
|
|
|
+func IndustrialManagementHotMapGropuPermission() (mapResp map[int]bool, err error) {
|
|
|
+ var topCond string
|
|
|
+ var topPars []interface{}
|
|
|
+ toplist, err := models.GetTopOneMonthArtReadNumIndustryAll(topCond, topPars)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mapPermission := make(map[int][]*models.IndustrialManagement)
|
|
|
+ mapPermissionMax := make(map[int]int)
|
|
|
+
|
|
|
+ for _, v := range toplist {
|
|
|
+ item := new(models.IndustrialManagement)
|
|
|
+ item.ChartPermissionId = v.ChartPermissionId
|
|
|
+ item.IndustrialManagementId = v.IndustrialManagementId
|
|
|
+ item.ArticleReadNum = v.ArticleReadNum
|
|
|
+ mapPermission[v.ChartPermissionId] = append(mapPermission[v.ChartPermissionId], item)
|
|
|
+ }
|
|
|
+ for k, v := range mapPermission {
|
|
|
+ for _, item := range v {
|
|
|
+ //mapPermissionMax[k] = item.ArticleReadNum
|
|
|
+ if item.ArticleReadNum > mapPermissionMax[k] {
|
|
|
+ mapPermissionMax[k] = item.ArticleReadNum
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ mapResp = make(map[int]bool, 0)
|
|
|
+ for _, v := range toplist {
|
|
|
+ if v.ArticleReadNum == mapPermissionMax[v.ChartPermissionId] {
|
|
|
+ mapResp[v.IndustrialManagementId] = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|