dengbiao пре 1 недеља
родитељ
комит
d253a63d8a
3 измењених фајлова са 44 додато и 38 уклоњено
  1. +14
    -12
      rule/egg_energy/activity_coin_auto_exchange_egg_energy.go
  2. +5
    -5
      rule/egg_energy/available_green_energy_settlement.go
  3. +25
    -21
      rule/egg_energy/give_activty_coin.go

+ 14
- 12
rule/egg_energy/activity_coin_auto_exchange_egg_energy.go Прегледај датотеку

@@ -70,18 +70,20 @@ func ActivityCoinAutoExchangeEggPersonEnergy(engine *xorm.Engine, req md.EggEner
_ = session.Rollback()
return
}
err = rule.DealUserVirtualCoin(session, md2.DealUserVirtualCoinReq{
Kind: "add",
Title: enum.PersonEggGetByEnergyEggPointCoin.String(),
TransferType: int(enum.PersonEggGetByEnergyEggPointCoin),
CoinId: req.PersonEggEnergyCoinId,
Uid: req.Uid,
Amount: amountForTeam,
})
if err != nil {
fmt.Println("ActivityCoinAutoExchangeEggEnergy:::::err222:::", err)
_ = session.Rollback()
return
if amountForTeam > 0 {
err = rule.DealUserVirtualCoin(session, md2.DealUserVirtualCoinReq{
Kind: "add",
Title: enum.TeamEggGetByEnergyEggPointCoin.String(),
TransferType: int(enum.TeamEggGetByEnergyEggPointCoin),
CoinId: req.TeamEggEnergyCoinId,
Uid: req.Uid,
Amount: amountForTeam,
})
if err != nil {
fmt.Println("ActivityCoinAutoExchangeEggEnergy:::::err222:::", err)
_ = session.Rollback()
return
}
}

//3、修改sign记录


+ 5
- 5
rule/egg_energy/available_green_energy_settlement.go Прегледај датотеку

@@ -53,12 +53,12 @@ func CalcPriceReductionFormula(userExchangeNumsValue string, eggEnergyCoreData *
if v.VipLevelId == levelId {
exchangeAccountBalanceFeeValue = v.ExchangeAccountBalanceFee
}
if exchangeAccountBalanceFeeValue == "" {
err = errors.New("未查询到当前会员等级兑换余额手续费")
return
}
exchangeAccountBalanceFee, _ = decimal.NewFromString(exchangeAccountBalanceFeeValue) //兑换手续费
}
if exchangeAccountBalanceFeeValue == "" {
err = errors.New("未查询到当前会员等级兑换余额手续费")
return
}
exchangeAccountBalanceFee, _ = decimal.NewFromString(exchangeAccountBalanceFeeValue) //兑换手续费
}

decimalRate := decimal.NewFromInt(100) //百分比


+ 25
- 21
rule/egg_energy/give_activty_coin.go Прегледај датотеку

@@ -237,31 +237,35 @@ func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ecpm strin
}

//给相应的用户上级加上"团队"活跃积分
err = rule.DealUserVirtualCoin(session, md.DealUserVirtualCoinReq{
Kind: "add",
Title: enum.UserVirtualAmountFlowTransferType.String(enum.EggEnergyWatchAdRewardFansActiveCoin),
TransferType: int(enum.EggEnergyWatchAdRewardFansActiveCoin),
CoinId: eggEnergyBasicSetting.TeamEggPointsCoinId,
Uid: user.ParentUid,
Amount: fatherRewardValue,
})
if err != nil {
_ = session.Rollback()
fmt.Println("err:::::2222", err)
return rewardValue, err
if fatherRewardValue > 0 {
err = rule.DealUserVirtualCoin(session, md.DealUserVirtualCoinReq{
Kind: "add",
Title: enum.UserVirtualAmountFlowTransferType.String(enum.EggEnergyWatchAdRewardFansActiveCoin),
TransferType: int(enum.EggEnergyWatchAdRewardFansActiveCoin),
CoinId: eggEnergyBasicSetting.TeamEggPointsCoinId,
Uid: user.ParentUid,
Amount: fatherRewardValue,
})
if err != nil {
_ = session.Rollback()
fmt.Println("err:::::2222", err)
return rewardValue, err
}
}

//给相应的用户加上"团队"活跃积分
for _, vv := range rewardFather {
//TODO::推入rabbitmq 异步处理
ch.Publish(md2.EggEnergyExchange, md.DealUserVirtualCoinReq{
Kind: "add",
Title: enum.UserVirtualAmountFlowTransferType.String(enum.EggEnergyWatchAdRewardTeamActiveCoin),
TransferType: int(enum.EggEnergyWatchAdRewardTeamActiveCoin),
CoinId: eggEnergyBasicSetting.TeamEggPointsCoinId,
Uid: vv.Uid,
Amount: vv.RewardValue,
}, md2.EggEnergyRoutKeyForSettlementPublicGiveActivityCoin)
if vv.RewardValue > 0 {
//TODO::推入rabbitmq 异步处理
ch.Publish(md2.EggEnergyExchange, md.DealUserVirtualCoinReq{
Kind: "add",
Title: enum.UserVirtualAmountFlowTransferType.String(enum.EggEnergyWatchAdRewardTeamActiveCoin),
TransferType: int(enum.EggEnergyWatchAdRewardTeamActiveCoin),
CoinId: eggEnergyBasicSetting.TeamEggPointsCoinId,
Uid: vv.Uid,
Amount: vv.RewardValue,
}, md2.EggEnergyRoutKeyForSettlementPublicGiveActivityCoin)
}
}
err = session.Commit()
if err != nil {


Loading…
Откажи
Сачувај