From dfefa70bb9ec8c79d0b2efcac0941ba530d59462 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 10 Jan 2023 16:02:26 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/user_analysis_for_activity.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/models/user_analysis_for_activity.go b/models/user_analysis_for_activity.go index 6d8201e69..d872669e6 100644 --- a/models/user_analysis_for_activity.go +++ b/models/user_analysis_for_activity.go @@ -480,5 +480,13 @@ func QueryUserAnnualReport(userId int64) *UserSummaryCurrentYear { } else { log.Info("error:=" + err.Error()) } + dbuser, err := GetUserByID(userId) + if err == nil { + return &UserSummaryCurrentYear{ + ID: dbuser.ID, + Name: dbuser.Name, + RegistDate: dbuser.CreatedUnix, + } + } return nil } From d514a8241843ecb43e015fe3991b066145e2f8e0 Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 11 Jan 2023 11:25:21 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=95=B0=E6=8D=AE=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/user_business_analysis.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index b462d7458..8e5e15dbd 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -897,10 +897,13 @@ func getBonusWeekDataMap() map[int64][]int { if len(aLine) < 4 { continue } + log.Info("aLine=" + lines[j]) + userId := getInt64Value(aLine[0]) order := getIntValue(aLine[2]) money := getIntValue(aLine[3]) week, num := getWeekAndNum(filenames[i]) + log.Info("userId=" + fmt.Sprint(userId) + " order=" + fmt.Sprint(order) + " money=" + fmt.Sprint(money) + " week=" + fmt.Sprint(week) + " num=" + fmt.Sprint(num)) //email := lines[2] record, ok := bonusMap[userId] if !ok { From e03a89bd26ee460573eeb4d919c2f875c4fb4935 Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 11 Jan 2023 11:54:29 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E5=BC=BA=E8=A1=8C=E5=8E=BB=E6=8E=89CSV=E6=9C=AB?= =?UTF-8?q?=E5=B0=BE=E7=9A=84=E7=89=B9=E6=AE=8A=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/user_business_analysis.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index 8e5e15dbd..b1fe53bd9 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -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]) From ae326f6c187e095ec309c7dfadc417f121e70af5 Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 11 Jan 2023 14:09:22 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=9B=9E=E8=BD=A6?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E7=AC=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/user_business_analysis.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index b1fe53bd9..93bb642c6 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -887,14 +887,17 @@ func getBonusWeekDataMap() map[int64][]int { if err == nil { filenames := strings.Split(content, "\n") for i := 0; i < len(filenames); i++ { + if strings.HasSuffix(filenames[i], "\r") { + filenames[i] = filenames[i][0 : len(filenames[i])-len("\r")] + } url = setting.RecommentRepoAddr + "bonus/weekdata/" + filenames[i] csvContent, err1 := GetContentFromPromote(url) if err1 == nil { //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")] + if strings.HasSuffix(lines[j], "\r") { + lines[j] = lines[j][0 : len(lines[j])-len("\r")] } log.Info("aLine=" + lines[j]) aLine := strings.Split(lines[j], ",") From 75f01526bf1e91cb3b8110a98ba0ffd5e8fa1e7f Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 11 Jan 2023 14:12:00 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E8=A7=A3=E5=86=B3=E5=9B=9E=E8=BD=A6=E6=8D=A2=E8=A1=8C?= =?UTF-8?q?=E7=AC=A6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/user_business_analysis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index 93bb642c6..351723199 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -908,7 +908,7 @@ func getBonusWeekDataMap() map[int64][]int { order := getIntValue(aLine[2]) money := getIntValue(aLine[3]) week, num := getWeekAndNum(filenames[i]) - log.Info("userId=" + fmt.Sprint(userId) + " order=" + fmt.Sprint(order) + " money=" + fmt.Sprint(money) + " week=" + fmt.Sprint(week) + " num=" + fmt.Sprint(num)) + //log.Info("userId=" + fmt.Sprint(userId) + " order=" + fmt.Sprint(order) + " money=" + fmt.Sprint(money) + " week=" + fmt.Sprint(week) + " num=" + fmt.Sprint(num)) //email := lines[2] record, ok := bonusMap[userId] if !ok { From bd9ea70be9845b06e1d4f80640d1d7c69f92f5dd Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 11 Jan 2023 14:13:07 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E8=A7=A3=E5=86=B3=E5=9B=9E=E8=BD=A6=E6=8D=A2=E8=A1=8C?= =?UTF-8?q?=E7=AC=A6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/user_business_analysis.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index 351723199..ee1b17544 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -957,12 +957,18 @@ func getBonusMap() map[string]map[string]int { if err == nil { filenames := strings.Split(content, "\n") for i := 0; i < len(filenames); i++ { + if strings.HasSuffix(filenames[i], "\r") { + filenames[i] = filenames[i][0 : len(filenames[i])-len("\r")] + } url = setting.RecommentRepoAddr + "bonus/" + filenames[i] csvContent, err1 := GetContentFromPromote(url) if err1 == nil { //read csv lines := strings.Split(csvContent, "\n") for j := 1; j < len(lines); j++ { + if strings.HasSuffix(lines[j], "\r") { + lines[j] = lines[j][0 : len(lines[j])-len("\r")] + } aLine := strings.Split(lines[j], ",") if len(aLine) < 7 { continue