Bläddra i källkod

add reverse:for v4.1.1 积分释放规则

tags/v4.1.1
huangjiajun 2 år sedan
förälder
incheckning
09e0fc727a
2 ändrade filer med 7 tillägg och 7 borttagningar
  1. +4
    -4
      rule/integral_release_settlement.go
  2. +3
    -3
      svc/svc_deal_user_amount.go

+ 4
- 4
rule/integral_release_settlement.go Visa fil

@@ -366,7 +366,7 @@ func DealUserCoinForIntegralRelease(session *xorm.Session, req md.DealUserCoinRe
return err
}
coinAmountValue := decimal.NewFromFloat(zhios_order_relate_utils.StrToFloat64(coinAmount))
amountValue := decimal.NewFromFloat(req.Amount).RoundFloor(4)
amountValue := decimal.NewFromFloat(req.Amount).RoundFloor(8)

var userVirtualCoinFlow model.UserVirtualCoinFlow
userVirtualCoinFlow.CoinId = req.CoinId
@@ -380,10 +380,10 @@ func DealUserCoinForIntegralRelease(session *xorm.Session, req md.DealUserCoinRe
userVirtualCoinFlow.CreateTime = now
if req.Kind == "add" {
userVirtualCoinFlow.Direction = 1
userVirtualCoinFlow.AfterAmout = coinAmountValue.Add(amountValue).RoundFloor(4).String()
userVirtualCoinFlow.AfterAmout = coinAmountValue.Add(amountValue).RoundFloor(8).String()
} else if req.Kind == "sub" {
userVirtualCoinFlow.Direction = 2
userVirtualCoinFlow.AfterAmout = coinAmountValue.Sub(amountValue).RoundFloor(4).String()
userVirtualCoinFlow.AfterAmout = coinAmountValue.Sub(amountValue).RoundFloor(8).String()
} else {
err = errors.New("错误的kind类型")
return err
@@ -447,7 +447,7 @@ func DealIntegralReleaseInterpositionUserAmount(session *xorm.Session, req md.De
totalAmountValue := decimal.NewFromFloat(zhios_order_relate_utils.StrToFloat64(userAmount.TotalAmount))
waiteAmountValue := decimal.NewFromFloat(zhios_order_relate_utils.StrToFloat64(userAmount.WaiteAmount))
alreadyAmountValue := decimal.NewFromFloat(zhios_order_relate_utils.StrToFloat64(userAmount.AlreadyAmount))
amountValue := decimal.NewFromFloat(req.Amount).RoundFloor(4)
amountValue := decimal.NewFromFloat(req.Amount).RoundFloor(8)

var integralReleaseInterpositionUserFlow = model.IntegralReleaseInterpositionUserFlow{
Uid: req.Uid,


+ 3
- 3
svc/svc_deal_user_amount.go Visa fil

@@ -37,7 +37,7 @@ func DealUserAmount(session *xorm.Session, req md.DealUserAmount) (err error) {
return err
}
userAmountValue := decimal.NewFromFloat(zhios_order_relate_utils.StrToFloat64(userAmount))
amountValue := decimal.NewFromFloat(req.Amount).RoundFloor(4)
amountValue := decimal.NewFromFloat(req.Amount).RoundFloor(8)

var finUserFlow = model.FinUserFlow{
Uid: req.Uid,
@@ -54,10 +54,10 @@ func DealUserAmount(session *xorm.Session, req md.DealUserAmount) (err error) {
}
if req.Kind == "add" {
finUserFlow.Type = 0
finUserFlow.AfterAmount = userAmountValue.Add(amountValue).RoundFloor(4).String()
finUserFlow.AfterAmount = userAmountValue.Add(amountValue).RoundFloor(8).String()
} else if req.Kind == "sub" {
finUserFlow.Type = 1
finUserFlow.AfterAmount = userAmountValue.Sub(amountValue).RoundFloor(4).String()
finUserFlow.AfterAmount = userAmountValue.Sub(amountValue).RoundFloor(8).String()
} else {
err = errors.New("错误的kind类型")
return err


Laddar…
Avbryt
Spara