#4465 fix-4460

Merged
chenyifan01 merged 1 commits from fix-4460 into V20230718 10 months ago
  1. +4
    -4
      services/reward/admin_operate.go

+ 4
- 4
services/reward/admin_operate.go View File

@@ -51,7 +51,7 @@ func AdminBalanceOperate(req models.AdminRewardOperateReq, doer *models.User) er
return nil return nil
} }


func GetCSVFailedDatas(user *models.User, records [][]string) ([]models.CSVFailedData, int) {
func GetCSVFailedDatas(admimUser *models.User, records [][]string) ([]models.CSVFailedData, int) {
var SuccessNum int var SuccessNum int
var CSVFailedDatas []models.CSVFailedData var CSVFailedDatas []models.CSVFailedData
var RewardOperateType models.RewardOperateType var RewardOperateType models.RewardOperateType
@@ -77,12 +77,12 @@ func GetCSVFailedDatas(user *models.User, records [][]string) ([]models.CSVFaile
} }


targetUserId, _ := strconv.ParseInt(userId, 10, 64) targetUserId, _ := strconv.ParseInt(userId, 10, 64)
user, err := models.GetUserByID(targetUserId)
targetUser, err := models.GetUserByID(targetUserId)
if err != nil { if err != nil {
CSVFailedDatas = append(CSVFailedDatas, models.CSVFailedData{pointUser, "userid not found"}) CSVFailedDatas = append(CSVFailedDatas, models.CSVFailedData{pointUser, "userid not found"})
continue continue
} }
if userName != user.Name {
if userName != targetUser.Name {
CSVFailedDatas = append(CSVFailedDatas, models.CSVFailedData{pointUser, "userName not found"}) CSVFailedDatas = append(CSVFailedDatas, models.CSVFailedData{pointUser, "userName not found"})
continue continue
} }
@@ -110,7 +110,7 @@ func GetCSVFailedDatas(user *models.User, records [][]string) ([]models.CSVFaile
Amount: amountNum, Amount: amountNum,
Remark: remark, Remark: remark,
RewardType: models.RewardTypePoint, RewardType: models.RewardTypePoint,
}, user)
}, admimUser)
if err != nil { if err != nil {
log.Error("OperatePointAccountBalance error.%v", err) log.Error("OperatePointAccountBalance error.%v", err)
CSVFailedDatas = append(CSVFailedDatas, models.CSVFailedData{pointUser, "OperatePointAccountBalance error."}) CSVFailedDatas = append(CSVFailedDatas, models.CSVFailedData{pointUser, "OperatePointAccountBalance error."})


Loading…
Cancel
Save