From 14e88c043f56125fcf31c24b3e5f511d69279a5f Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Fri, 25 Nov 2022 20:30:06 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=B8=AD=E5=9F=BA=E7=A7=AF=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rule/integral_release_settlement.go | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/rule/integral_release_settlement.go b/rule/integral_release_settlement.go index f31dd86..caaec88 100644 --- a/rule/integral_release_settlement.go +++ b/rule/integral_release_settlement.go @@ -106,7 +106,19 @@ func DailySettlementIntegralRelease(engine *xorm.Engine, mid string, isTask bool } } - //3、提交事务 + //3、更新 `integral_release_basic` 表 + integralRelease.ReleaseDate = today + updateAffected, err := db.IntegralReleaseUpdate(session, integralRelease.Id, integralRelease) + if err != nil { + _ = session.Rollback() + return err + } + if updateAffected == 0 { + _ = session.Rollback() + return errors.New("更新 integral_release_basic 记录失败") + } + + //4、提交事务 err = session.Commit() if err != nil { _ = session.Rollback() @@ -203,19 +215,8 @@ func DailySettlementIntegralReleaseForInterposition(engine *xorm.Engine, mid str return err } } - //3、更新 `integral_release_basic` 表 - integralRelease.ReleaseDate = today - updateAffected, err := db.IntegralReleaseUpdate(session, integralRelease.Id, integralRelease) - if err != nil { - _ = session.Rollback() - return err - } - if updateAffected == 0 { - _ = session.Rollback() - return errors.New("更新 integral_release_basic 记录失败") - } - //4、提交事务 + //3、提交事务 err = session.Commit() if err != nil { _ = session.Rollback()