|
|
@@ -900,20 +900,27 @@ func getBonusWeekDataMap() map[int64][]int { |
|
|
|
userId := getInt64Value(aLine[0]) |
|
|
|
order := getIntValue(aLine[2]) |
|
|
|
money := getIntValue(aLine[3]) |
|
|
|
week, num := getWeekAndNum(filenames[i]) |
|
|
|
//email := lines[2] |
|
|
|
record, ok := bonusMap[userId] |
|
|
|
if !ok { |
|
|
|
record = make([]int, 2) |
|
|
|
record = make([]int, 4) |
|
|
|
record[0] = order |
|
|
|
record[1] = money |
|
|
|
record[2] = week |
|
|
|
record[3] = num |
|
|
|
bonusMap[userId] = record |
|
|
|
} else { |
|
|
|
if record[0] > order { |
|
|
|
record[0] = order |
|
|
|
record[1] = money |
|
|
|
record[2] = week |
|
|
|
record[3] = num |
|
|
|
} else { |
|
|
|
if record[0] == order && record[1] < money { |
|
|
|
record[1] = money |
|
|
|
record[2] = week |
|
|
|
record[3] = num |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@@ -924,6 +931,17 @@ func getBonusWeekDataMap() map[int64][]int { |
|
|
|
return bonusMap |
|
|
|
} |
|
|
|
|
|
|
|
func getWeekAndNum(name string) (int, int) { |
|
|
|
name = name[0 : len(name)-4] |
|
|
|
tmp := strings.Split(name, "_") |
|
|
|
if len(tmp) == 2 { |
|
|
|
week := getIntValue(tmp[0]) |
|
|
|
num := getIntValue(tmp[1]) |
|
|
|
return week, num |
|
|
|
} |
|
|
|
return 0, 0 |
|
|
|
} |
|
|
|
|
|
|
|
func getBonusMap() map[string]map[string]int { |
|
|
|
bonusMap := make(map[string]map[string]int) |
|
|
|
url := setting.RecommentRepoAddr + "bonus/record.txt" |
|
|
|