From 3a5a3bcd4ca2af60601f03a66567593b712c9721 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Fri, 26 Jan 2024 17:22:31 +0800 Subject: [PATCH] update --- .../one_circles_sign_in_green_energy_settlement.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/rule/one_circles/one_circles_sign_in_green_energy_settlement.go b/rule/one_circles/one_circles_sign_in_green_energy_settlement.go index c3e271b..11dcb33 100644 --- a/rule/one_circles/one_circles_sign_in_green_energy_settlement.go +++ b/rule/one_circles/one_circles_sign_in_green_energy_settlement.go @@ -111,11 +111,13 @@ func SettlementSignInGreenEnergy(engine *xorm.Engine, masterId string) (err erro } //5、减少“活跃赠送” 中的绿色能量 - err = DealAvailableGreenEnergyCoin(session, int(enum.SignInReward), reduceTotalGreenEnergy, enum.SignInReward.String(), oneCirclesGreenEnergyBasicSetting, oneCirclesGreenEnergyBasicSetting.NowPrice) - if err != nil { - _ = session.Rollback() - fmt.Println("err:::::55555", err) - return err + if reduceTotalGreenEnergy > 0 { + err = DealAvailableGreenEnergyCoin(session, int(enum.SignInReward), reduceTotalGreenEnergy, enum.SignInReward.String(), oneCirclesGreenEnergyBasicSetting, oneCirclesGreenEnergyBasicSetting.NowPrice) + if err != nil { + _ = session.Rollback() + fmt.Println("err:::::55555", err) + return err + } } err = session.Commit() if err != nil {