From e9b3fce2f763a06533f240d480581a6488de1b81 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Sat, 11 May 2024 15:58:33 +0800 Subject: [PATCH] update --- ...circles_sign_in_green_energy_settlement.go | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 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 e2fd348..b975deb 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 @@ -159,16 +159,30 @@ func HandleSettlementSignInGreenEnergy(engine *xorm.Engine, masterId string, id } //TODO::判断是否活跃 var m model.OneCirclesGreenEnergySignIn - has, err3333333 := engine.Where("uid =?", relate.ParentUid).And("end_time >=?", endTime).Get(&m) - if err3333333 != nil { - _ = session.Rollback() - fmt.Println("err:::::3333333", err3333333) - return err3333333 - } - if !has { - //不活跃不需要奖励 - continue + if endTime != "" { + has, err3333333 := engine.Where("uid =?", relate.ParentUid).And("end_time >=?", endTime).Get(&m) + if err3333333 != nil { + _ = session.Rollback() + fmt.Println("err:::::3333333", err3333333) + return err3333333 + } + if !has { + //不活跃不需要奖励 + continue + } + } else { + has, err3333333 := engine.Where("uid =?", relate.ParentUid).And("end_time >=?", time.Now().Format("2006-01-02 15:04:05")).Get(&m) + if err3333333 != nil { + _ = session.Rollback() + fmt.Println("err:::::3333333", err3333333) + return err3333333 + } + if !has { + //不活跃不需要奖励 + continue + } } + err = DealUserCoin(session, md.DealUserCoinReq{ Kind: "add", Mid: masterId,