| @@ -785,16 +785,20 @@ func getBonusMap() map[string]map[string]int { | |||||
| //read csv | //read csv | ||||
| lines := strings.Split(csvContent, "\n") | lines := strings.Split(csvContent, "\n") | ||||
| for j := 1; j < len(lines); j++ { | for j := 1; j < len(lines); j++ { | ||||
| userName := lines[1] | |||||
| aLine := strings.Split(lines[j], ",") | |||||
| if len(aLine) < 7 { | |||||
| continue | |||||
| } | |||||
| userName := aLine[1] | |||||
| //email := lines[2] | //email := lines[2] | ||||
| record, ok := bonusMap[userName] | record, ok := bonusMap[userName] | ||||
| if !ok { | if !ok { | ||||
| record = make(map[string]int) | record = make(map[string]int) | ||||
| } | } | ||||
| record["times"] = getMapKeyStringValue("times", record) + getIntValue(lines[3]) | |||||
| record["total_bonus"] = getMapKeyStringValue("total_bonus", record) + getIntValue(lines[4]) | |||||
| record["total_cardtime"] = getMapKeyStringValue("total_cardtime", record) + getIntValue(lines[5]) | |||||
| record["total_giveup"] = getMapKeyStringValue("total_giveup", record) + getIntValue(lines[6]) | |||||
| record["times"] = getMapKeyStringValue("times", record) + getIntValue(aLine[3]) | |||||
| record["total_bonus"] = getMapKeyStringValue("total_bonus", record) + getIntValue(aLine[4]) | |||||
| record["total_cardtime"] = getMapKeyStringValue("total_cardtime", record) + getIntValue(aLine[5]) | |||||
| record["total_giveup"] = getMapKeyStringValue("total_giveup", record) + getIntValue(aLine[6]) | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||