Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.21.12.1^2
zouap 4 years ago
parent
commit
b40c97627c
1 changed files with 0 additions and 59 deletions
  1. +0
    -59
      models/user_business_analysis.go

+ 0
- 59
models/user_business_analysis.go View File

@@ -680,65 +680,6 @@ func CounDataByDateAndReCount(wikiCountMap map[string]int, startTime time.Time,
return nil
}

// func updateCurrentData(userId int64, statictisSess *xorm.Session, currentData UserBusinessAnalysis) {

// _, err := statictisSess.Update("update user_business_analysis_all set code_merge_count+=" + fmt.Sprint(currentData.CodeMergeCount) +
// ",commit_count+=" + fmt.Sprint(currentData.CommitCount) +
// ",issue_count+=" + fmt.Sprint(currentData.IssueCount) +
// ",comment_count+=" + fmt.Sprint(currentData.CommentCount) +
// ",focus_repo_count+=" + fmt.Sprint(currentData.FocusRepoCount) +
// ",star_repo_count+=" + fmt.Sprint(currentData.StarRepoCount) +
// ",watched_count+=" + fmt.Sprint(currentData.WatchedCount) +
// ",commit_code_size+=" + fmt.Sprint(currentData.CommitCodeSize) +
// ",commit_dataset_size+=" + fmt.Sprint(currentData.CommitDatasetSize) +
// ",commit_model_count+=" + fmt.Sprint(currentData.CommitModelCount) +
// ",solve_issue_count+=" + fmt.Sprint(currentData.SolveIssueCount) +
// ",encyclopedias_count+=" + fmt.Sprint(currentData.EncyclopediasCount) +
// ",create_repo_count+=" + fmt.Sprint(currentData.CreateRepoCount) +
// ",login_count+=" + fmt.Sprint(currentData.LoginCount) +
// " where id=" + fmt.Sprint(userId))

// if err != nil {
// log.Info("update table failed." + err.Error())
// }

// }

// func isExistUserInAllTable(userId int64, statictisSess *xorm.Session) bool {

// allCount, err := statictisSess.Where("id=" + fmt.Sprint(userId)).Count(new(UserBusinessAnalysisAll))
// if err != nil {
// return false
// }
// return allCount > 0
// }

// func getAllData(userId int64, statictisSess *xorm.Session) UserBusinessAnalysisAll {
// var dateRecord UserBusinessAnalysisAll

// rows, err := statictisSess.Query("select sum(code_merge_count) as code_merge_count,sum(commit_count) as commit_count,sum(issue_count) as issue_count,sum(issue_count) as issue_count,sum(comment_count) as comment_count,sum(focus_repo_count) as focus_repo_count,sum(star_repo_count) as star_repo_count,sum(watched_count) as watched_count,sum(commit_code_size) as commit_code_size,sum(commit_dataset_size) as commit_dataset_size, sum(commit_model_count) as commit_model_count,sum(solve_issue_count) as solve_issue_count,sum(encyclopedias_count) as encyclopedias_count, sum(create_repo_count) as create_repo_count,sum(login_count) as login_count from public.user_business_analysis where id=" + fmt.Sprint(userId) + " group by id")
// if err == nil {
// for i, row := range rows {
// log.Info("query user info, i=" + fmt.Sprint(i) + " code_merge_count=" + string(row["code_merge_count"]))
// dateRecord.CodeMergeCount = getInt(string(row["code_merge_count"]))
// dateRecord.CommitCount = getInt(string(row["commit_count"]))
// dateRecord.IssueCount = getInt(string(row["issue_count"]))
// dateRecord.CommentCount = getInt(string(row["comment_count"]))
// dateRecord.FocusRepoCount = getInt(string(row["focus_repo_count"]))
// dateRecord.StarRepoCount = getInt(string(row["star_repo_count"]))
// dateRecord.WatchedCount = getInt(string(row["watched_count"]))
// dateRecord.CommitCodeSize = getInt(string(row["commit_code_size"]))
// dateRecord.CommitDatasetSize = getInt(string(row["commit_dataset_size"]))
// dateRecord.CommitModelCount = getInt(string(row["commit_model_count"]))
// dateRecord.SolveIssueCount = getInt(string(row["solve_issue_count"]))
// dateRecord.EncyclopediasCount = getInt(string(row["encyclopedias_count"]))
// dateRecord.CreateRepoCount = getInt(string(row["create_repo_count"]))
// dateRecord.LoginCount = getInt(string(row["login_count"]))
// }
// }
// return dateRecord
// }

func getInt(str string) int {
re, err := strconv.ParseInt(str, 10, 32)
if err != nil {


Loading…
Cancel
Save