diff --git a/models/custom_migrations.go b/models/custom_migrations.go index 9cb0545b7..0bd52da67 100644 --- a/models/custom_migrations.go +++ b/models/custom_migrations.go @@ -14,10 +14,11 @@ type CustomMigration struct { var customMigrations = []CustomMigration{ {"Custom v1 Topic struct change to support chinese", syncTopicStruct}, - {"Delete zuzhi user history data ", deleteNotDisplayUser}, } -var customMigrationsStatic = []CustomMigration{} +var customMigrationsStatic = []CustomMigration{ + {"Delete zuzhi user history data ", deleteNotDisplayUser}, +} func MigrateCustom(x *xorm.Engine) { diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index ee5f2ccfb..ac51c2816 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -578,7 +578,7 @@ func queryUserRepoOpenIIndex(start_unix int64, end_unix int64) map[int64]float64 log.Info("query Repository size=" + fmt.Sprint(len(repoList))) for _, repoRecord := range repoList { if _, ok := userMap[repoRecord.OwnerID]; !ok { - if _, ok := repoOpenIIndexMap[repoRecord.ID]; !ok { + if _, ok := repoOpenIIndexMap[repoRecord.ID]; ok { userMap[repoRecord.OwnerID] = repoOpenIIndexMap[repoRecord.ID] } } @@ -588,13 +588,16 @@ func queryUserRepoOpenIIndex(start_unix int64, end_unix int64) map[int64]float64 sess.Select("repo_id,user_id,mode").Table("collaboration") collaborationList := make([]*Collaboration, 0) sess.Find(&collaborationList) + + log.Info("query collaborationList size=" + fmt.Sprint(len(collaborationList))) + for _, collaborationRecord := range collaborationList { if _, ok := userMap[collaborationRecord.UserID]; !ok { - if _, ok := repoOpenIIndexMap[collaborationRecord.RepoID]; !ok { + if _, ok := repoOpenIIndexMap[collaborationRecord.RepoID]; ok { userMap[collaborationRecord.UserID] = repoOpenIIndexMap[collaborationRecord.RepoID] } } else { - if _, ok := repoOpenIIndexMap[collaborationRecord.RepoID]; !ok { + if _, ok := repoOpenIIndexMap[collaborationRecord.RepoID]; ok { userMap[collaborationRecord.UserID] += repoOpenIIndexMap[collaborationRecord.RepoID] } }