|
|
|
@@ -610,7 +610,7 @@ func refreshUserStaticTable(wikiCountMap map[string]int, tableName string, pageS |
|
|
|
|
|
|
|
DataDate := currentTimeNow.Format("2006-01-02") + " 00:01" |
|
|
|
bonusMap := make(map[string]map[string]int) |
|
|
|
if tableName == "user_business_analysis_current_year" { |
|
|
|
if isUserYearData(tableName) { |
|
|
|
bonusMap = getBonusMap() |
|
|
|
log.Info("truncate all data from table:user_summary_current_year ") |
|
|
|
statictisSess.Exec("TRUNCATE TABLE user_summary_current_year") |
|
|
|
@@ -712,7 +712,7 @@ func refreshUserStaticTable(wikiCountMap map[string]int, tableName string, pageS |
|
|
|
userMetrics["TotalHasActivityUser"] = getMapKeyStringValue("TotalHasActivityUser", userMetrics) + 1 |
|
|
|
} |
|
|
|
} |
|
|
|
if tableName == "user_business_analysis_current_year" { |
|
|
|
if isUserYearData(tableName) { |
|
|
|
//年度数据 |
|
|
|
subTime := time.Now().UTC().Sub(dateRecordAll.RegistDate.AsTime().UTC()) |
|
|
|
mostActiveDay := "" |
|
|
|
@@ -772,6 +772,16 @@ func refreshUserStaticTable(wikiCountMap map[string]int, tableName string, pageS |
|
|
|
log.Info("refresh data finished.tableName=" + tableName + " total record:" + fmt.Sprint(insertCount)) |
|
|
|
} |
|
|
|
|
|
|
|
func isUserYearData(tableName string) bool { |
|
|
|
if tableName == "user_business_analysis_current_year" { |
|
|
|
currentTimeNow := time.Now() |
|
|
|
if currentTimeNow.Year() >= 2023 { |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
return true |
|
|
|
} |
|
|
|
|
|
|
|
func getBonusMap() map[string]map[string]int { |
|
|
|
bonusMap := make(map[string]map[string]int) |
|
|
|
url := setting.RecommentRepoAddr + "bonus/record.txt" |
|
|
|
|