Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
pull/1036/head
zouap 3 years ago
parent
commit
6a2b296825
2 changed files with 9 additions and 5 deletions
  1. +3
    -2
      models/custom_migrations.go
  2. +6
    -3
      models/user_business_analysis.go

+ 3
- 2
models/custom_migrations.go View File

@@ -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) {



+ 6
- 3
models/user_business_analysis.go View File

@@ -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]
}
}


Loading…
Cancel
Save