Browse Source

提交代码,强行去掉CSV末尾的特殊字符

Signed-off-by: zouap <zouap@pcl.ac.cn>
pull/3518/head
zouap 2 years ago
parent
commit
e03a89bd26
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      models/user_business_analysis.go

+ 4
- 2
models/user_business_analysis.go View File

@@ -893,12 +893,14 @@ func getBonusWeekDataMap() map[int64][]int {
//read csv
lines := strings.Split(csvContent, "\n")
for j := 1; j < len(lines); j++ {
if strings.HasSuffix(lines[j], "\01503d") {
lines[j] = lines[j][0 : len(lines[j])-len("\01503d")]
}
log.Info("aLine=" + lines[j])
aLine := strings.Split(lines[j], ",")
if len(aLine) < 4 {
continue
}
log.Info("aLine=" + lines[j])

userId := getInt64Value(aLine[0])
order := getIntValue(aLine[2])
money := getIntValue(aLine[3])


Loading…
Cancel
Save