Browse Source

Merge remote-tracking branch 'origin/V20221228' into fix-csh

pull/3520/head
chenshihai 2 years ago
parent
commit
f78cf3fdf6
2 changed files with 22 additions and 0 deletions
  1. +8
    -0
      models/user_analysis_for_activity.go
  2. +14
    -0
      models/user_business_analysis.go

+ 8
- 0
models/user_analysis_for_activity.go View File

@@ -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
}

+ 14
- 0
models/user_business_analysis.go View File

@@ -887,12 +887,19 @@ 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], "\r") {
lines[j] = lines[j][0 : len(lines[j])-len("\r")]
}
log.Info("aLine=" + lines[j])
aLine := strings.Split(lines[j], ",")
if len(aLine) < 4 {
continue
@@ -901,6 +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))
//email := lines[2]
record, ok := bonusMap[userId]
if !ok {
@@ -949,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


Loading…
Cancel
Save