From b1ab570d55e3d60845aa860cf9394ac35f90361e Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Sun, 5 Jan 2025 03:41:23 +0800 Subject: [PATCH] update --- consume/egg_publish_consume.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/consume/egg_publish_consume.go b/consume/egg_publish_consume.go index f7f5212..0643659 100644 --- a/consume/egg_publish_consume.go +++ b/consume/egg_publish_consume.go @@ -125,14 +125,16 @@ func handleEggPublishDataConsume(msgData []byte) error { } else { // 待结不够扣 // 扣完当前待结余额 - err = rule.DealUserVirtualCoinMinus(session, md3.DealUserVirtualCoinReq{ - Kind: "sub", - Title: enum.EggEnergyMaliciousAccountFlashingDeductionTeam.String(), - TransferType: int(enum.EggEnergyMaliciousAccountFlashingDeductionTeam), - CoinId: setting.TeamEggEnergyCoinId, - Uid: msg.Uid, - Amount: utils2.StrToFloat64(userVirtualWallet.Amount), - }) + if utils2.StrToFloat64(userVirtualWallet.Amount) > 0 { + err = rule.DealUserVirtualCoinMinus(session, md3.DealUserVirtualCoinReq{ + Kind: "sub", + Title: enum.EggEnergyMaliciousAccountFlashingDeductionTeam.String(), + TransferType: int(enum.EggEnergyMaliciousAccountFlashingDeductionTeam), + CoinId: setting.TeamEggEnergyCoinId, + Uid: msg.Uid, + Amount: utils2.StrToFloat64(userVirtualWallet.Amount), + }) + } remainingAmount := utils2.StrToFloat64(msg.Amount) - utils2.StrToFloat64(userVirtualWallet.Amount) err := rule.DealUserVirtualCoinMinus(session, md3.DealUserVirtualCoinReq{ Kind: "sub",