Browse Source

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

tags/v4.0.4
huangjiajun 2 years ago
parent
commit
a84757c8b9
2 changed files with 34 additions and 12 deletions
  1. +16
    -12
      md/block_star_chain.go
  2. +18
    -0
      rule/integral_release_settlement.go

+ 16
- 12
md/block_star_chain.go View File

@@ -42,12 +42,14 @@ const (
BlockGreenChainTransactionAndDestroyTitleForUserVirtualCoinFlow = "绿色积分-交易(销毁贡献值)"
BlockGreenChainAdminDestroyTitleForUserVirtualCoinFlow = "绿色积分-管理员销毁"

IntegralReleaseRedCoinGrantByOrdTitleForUserVirtualCoinFlow = "积分释放-红积分发放(订单)"
IntegralReleaseRedCoinGrantBySignInTitleForUserVirtualCoinFlow = "积分释放-红积分发放(签到)"
IntegralReleaseRedCoinGrantByRefundForUserVirtualCoinFlow = "订单退款-红积分扣除"
IntegralReleaseGreenCoinGrantByRefundForUserVirtualCoinFlow = "订单退款-绿积分扣除"
IntegralReleaseGreenCoinGrantByOrdTitleForUserVirtualCoinFlow = "积分释放-绿积分发放(订单)"
IntegralReleaseGreenCoinGrantBySignInTitleForUserVirtualCoinFlow = "积分释放-绿积分发放(签到)"
IntegralReleaseRedCoinGrantByOrdTitleForUserVirtualCoinFlow = "积分释放-红积分发放(订单)"
IntegralReleaseRedCoinGrantBySignInTitleForUserVirtualCoinFlow = "积分释放-红积分发放(签到)"
IntegralReleaseRedCoinGrantByOrdTitleDeductForUserVirtualCoinFlow = "积分释放-红积分扣除(订单)"
IntegralReleaseRedCoinGrantBySignInTitleDeductForUserVirtualCoinFlow = "积分释放-红积分扣除(签到)"
IntegralReleaseRedCoinGrantByRefundForUserVirtualCoinFlow = "订单退款-红积分扣除"
IntegralReleaseGreenCoinGrantByRefundForUserVirtualCoinFlow = "订单退款-绿积分扣除"
IntegralReleaseGreenCoinGrantByOrdTitleForUserVirtualCoinFlow = "积分释放-绿积分发放(订单)"
IntegralReleaseGreenCoinGrantBySignInTitleForUserVirtualCoinFlow = "积分释放-绿积分发放(签到)"
)

const (
@@ -82,12 +84,14 @@ const (
BlockGreenChainTransactionAndDestroyTransferTypeForUserVirtualCoinFlow = 133 // 绿色积分-交易(销毁贡献值)
BlockGreenChainAdminDestroyTransferTypeForUserVirtualCoinFlow = 134 // 绿色积分-管理员销毁

IntegralReleaseRedCoinGrantByOrdTransferTypeForUserVirtualCoinFlow = 135 // 积分释放-红积分发放(订单)
IntegralReleaseRedCoinGrantBySignInTransferTypeForUserVirtualCoinFlow = 136 // 积分释放-红积分发放(签到)
IntegralReleaseGreenCoinGrantByOrdTransferTypeForUserVirtualCoinFlow = 137 // 积分释放-绿积分发放(订单)
IntegralReleaseGreenCoinGrantBySignInTransferTypeForUserVirtualCoinFlow = 138 // 积分释放-绿积分发放(签到)
IntegralReleaseRedCoinGrantByOrdRefundTypeForUserVirtualCoinFlow = 139 // 订单退款-红积分扣除
IntegralReleaseGreenCoinGrantByOrdRefundTypeForUserVirtualCoinFlow = 140 // 订单退款-绿积分扣除
IntegralReleaseRedCoinGrantByOrdTransferTypeForUserVirtualCoinFlow = 135 // 积分释放-红积分发放(订单)
IntegralReleaseRedCoinGrantBySignInTransferTypeForUserVirtualCoinFlow = 136 // 积分释放-红积分发放(签到)
IntegralReleaseGreenCoinGrantByOrdTransferTypeForUserVirtualCoinFlow = 137 // 积分释放-绿积分发放(订单)
IntegralReleaseGreenCoinGrantBySignInTransferTypeForUserVirtualCoinFlow = 138 // 积分释放-绿积分发放(签到)
IntegralReleaseRedCoinGrantByOrdRefundTypeForUserVirtualCoinFlow = 139 // 订单退款-红积分扣除
IntegralReleaseGreenCoinGrantByOrdRefundTypeForUserVirtualCoinFlow = 140 // 订单退款-绿积分扣除
IntegralReleaseRedCoinGrantByOrdTransferTypeDeductForUserVirtualCoinFlow = 141 // 积分释放-红积分发放(订单)
IntegralReleaseRedCoinGrantBySignInTransferTypeDeductForUserVirtualCoinFlow = 142 // 积分释放-红积分发放(签到)

)



+ 18
- 0
rule/integral_release_settlement.go View File

@@ -234,9 +234,13 @@ func ReleaseGreenCoinForUser(session *xorm.Session, mid string, integralReleaseB
//2、释放绿积分
var title = md.IntegralReleaseGreenCoinGrantByOrdTitleForUserVirtualCoinFlow
var transferType = md.IntegralReleaseGreenCoinGrantByOrdTransferTypeForUserVirtualCoinFlow
var titleRed = md.IntegralReleaseRedCoinGrantByOrdTitleDeductForUserVirtualCoinFlow
var transferTypeRed = md.IntegralReleaseRedCoinGrantByOrdTransferTypeDeductForUserVirtualCoinFlow
if integralReleaseUserWithOrd.Pvd == 0 {
title = md.IntegralReleaseGreenCoinGrantBySignInTitleForUserVirtualCoinFlow
transferType = md.IntegralReleaseGreenCoinGrantBySignInTransferTypeForUserVirtualCoinFlow
titleRed = md.IntegralReleaseRedCoinGrantBySignInTitleDeductForUserVirtualCoinFlow
transferTypeRed = md.IntegralReleaseRedCoinGrantBySignInTransferTypeDeductForUserVirtualCoinFlow
}
err := DealUserCoinForIntegralRelease(session, md.DealUserCoinReq{
Kind: "add",
@@ -251,6 +255,20 @@ func ReleaseGreenCoinForUser(session *xorm.Session, mid string, integralReleaseB
if err != nil {
return err
}
//扣除红积分
err = DealUserCoinForIntegralRelease(session, md.DealUserCoinReq{
Kind: "sub",
Mid: mid,
Title: titleRed,
TransferType: transferTypeRed,
OrdId: integralReleaseUserWithOrd.OrdId,
CoinId: integralReleaseBasic.Coin1,
Uid: integralReleaseUserWithOrd.Uid,
Amount: zhios_order_relate_utils.StrToFloat64(releaseCoinNum.String()),
})
if err != nil {
return err
}
releasedGreenCoinNumBefore, _ := decimal.NewFromString(integralReleaseUserWithOrd.ReleasedGreenCoinNum)
releasedGreenCoinNumAfter := releasedGreenCoinNumBefore.Add(releaseCoinNum)



Loading…
Cancel
Save