|
|
@@ -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 { |
|
|
|