ソースを参照

fix:我的数量限制修改

duxin 1 年間 前
コミット
e6c01f0070

+ 6 - 3
src/jfw/modules/bigmember/src/service/analysis/businessIntelligence.go

@@ -142,11 +142,13 @@ func (l *BusinessIntelligence) MeListCount(classify string, userid string, data
 		count = qutil.If(allCount > maxCount, maxCount, allCount).(int64)
 		return
 	case "projectFollowCount": //项目关注
-		_, err := entity.CreateProjectFollowManager(l.Session())
+		followProjectManager, err := entity.CreateProjectFollowManager(l.Session())
 		if err != nil {
 			return
 		}
-		count = db.Base.CountBySql(`select count(*) from follow_project_monitor where s_userid= ?`, userid)
+		allCount := db.Base.CountBySql(`select count(*) from follow_project_monitor where s_userid= ?`, userid)
+		maxNum := gconv.Int64(followProjectManager.MaxNum)
+		count = qutil.If(allCount > maxNum, maxNum, allCount).(int64)
 		return
 	case "entFollowCount": //企业关注
 		followEntManager, err := entity.CreateEntFollowManager(l.Session())
@@ -154,7 +156,8 @@ func (l *BusinessIntelligence) MeListCount(classify string, userid string, data
 			return
 		}
 		allCount := db.Base.CountBySql(fmt.Sprintf(`SELECT count(*) FROM follow_ent_monitor WHERE  s_userid="%s" `, userid))
-		count = qutil.If(allCount > gconv.Int64(followEntManager.MaxNum), followEntManager.MaxNum, allCount).(int64)
+		maxNum := gconv.Int64(followEntManager.MaxNum)
+		count = qutil.If(allCount > maxNum, maxNum, allCount).(int64)
 		return
 	}
 }