diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index 4be8b9cf2..cb1970d23 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -842,9 +842,9 @@ func RefreshUserYearTable(pageStartTime time.Time, pageEndTime time.Time) { repoInfo := getRepoDetailInfo(DetailInfoMap, dateRecordAll.ID, MostDownloadMap) dataSetInfo, datasetscore := getDataSetInfo(dateRecordAll.ID, CreatedDataset, dataSetDownloadMap, CommitDatasetNumMap, CollectedDataset) scoreMap["datasetscore"] = datasetscore - codeInfo, codescore := getCodeInfo(dateRecordAll) + codeInfo, codescore := getCodeInfo(&dateRecordAll) scoreMap["codescore"] = codescore - cloudBrainInfo := getCloudBrainInfo(dateRecordAll, CloudBrainTaskItemMap, scoreMap) + cloudBrainInfo := getCloudBrainInfo(&dateRecordAll, CloudBrainTaskItemMap, scoreMap) playARoll := getPlayARoll(bonusMap, dateRecordAll.Name, scoreMap) re := &UserSummaryCurrentYear{ ID: dateRecordAll.ID, @@ -891,6 +891,8 @@ func getBonusWeekDataMap() map[int64][]int { if strings.HasSuffix(filenames[i], "\r") { filenames[i] = filenames[i][0 : len(filenames[i])-len("\r")] } + week, num := getWeekAndNum(filenames[i]) + log.Info("filenames[i]=" + filenames[i] + "week=" + fmt.Sprint(week) + " num=" + fmt.Sprint(num)) url = setting.RecommentRepoAddr + "bonus/weekdata/" + filenames[i] csvContent, err1 := GetContentFromPromote(url) if err1 == nil { @@ -908,7 +910,6 @@ func getBonusWeekDataMap() map[int64][]int { userId := getInt64Value(aLine[0]) order := getIntValue(aLine[2]) money := getIntValue(aLine[3]) - week, num := getWeekAndNum(filenames[i]) //log.Info("userId=" + fmt.Sprint(userId) + " order=" + fmt.Sprint(order) + " money=" + fmt.Sprint(money) + " week=" + fmt.Sprint(week) + " num=" + fmt.Sprint(num)) //email := lines[2] record, ok := bonusMap[userId] @@ -1028,7 +1029,7 @@ func getPlayARoll(bonusMap map[string]map[string]int, userName string, scoreMap } } -func getCloudBrainInfo(dateRecordAll UserBusinessAnalysisAll, CloudBrainTaskItemMap map[string]int, scoreMap map[string]float64) string { +func getCloudBrainInfo(dateRecordAll *UserBusinessAnalysisAll, CloudBrainTaskItemMap map[string]int, scoreMap map[string]float64) string { trainscore := 0.0 debugscore := 0.0 runtime := 0.0 @@ -1063,7 +1064,7 @@ func getCloudBrainInfo(dateRecordAll UserBusinessAnalysisAll, CloudBrainTaskItem } } -func getCodeInfo(dateRecordAll UserBusinessAnalysisAll) (string, float64) { +func getCodeInfo(dateRecordAll *UserBusinessAnalysisAll) (string, float64) { if dateRecordAll.CommitCount > 0 { codeInfo := make(map[string]string) codeInfo["commit_count"] = fmt.Sprint(dateRecordAll.CommitCount)