This commit is contained in:
lwl0608 2024-03-19 16:21:53 +08:00
parent d2e0a24bb3
commit 31a7247337
3 changed files with 8 additions and 3 deletions

View File

@ -2797,7 +2797,7 @@ func (v *Vas) refundContactWechat(ctx *gin.Context, order *dbstruct.CoinOrder, r
}
// 给用户加回金币
err = v.store.IncCoins(ctx, tx, mid, costCh.GetChange())
err = v.store.IncCoins(ctx, tx, mid, util.AbsInt64(costCh.GetMid()))
if err != nil {
logger.Error("IncCoins fail, mid: %v, change: %v, err: %v", mid, costCh.GetChange(), err)
return err

View File

@ -317,10 +317,10 @@ func (s *Service) chListIncome(ctx *gin.Context, chList []*dbstruct.ConsumeHisto
item.Change = changeMark + fmt.Sprintf("%d钻石", chDB.GetChange())
case dbstruct.CHSTypeIncomeRefundMembership:
item.Desc = "用户会员退款"
item.Change = changeMark + fmt.Sprintf("%d钻石", chDB.GetChange())
item.Change = fmt.Sprintf("%d钻石", chDB.GetChange())
case dbstruct.CHSTypeIncomeRefundContactWechat:
item.Desc = "用户微信退款"
item.Change = changeMark + fmt.Sprintf("%d钻石", chDB.GetChange())
item.Change = fmt.Sprintf("%d钻石", chDB.GetChange())
}
list = append(list, item)
}

View File

@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"io"
"math"
"math/rand"
"reflect"
"service/library/logger"
@ -135,3 +136,7 @@ func UnescapeJsonStr(s string) string {
s = strings.ReplaceAll(s, "\\u0026", "&")
return s
}
func AbsInt64(x int64) int64 {
return int64(math.Abs(float64(x)))
}