diff --git a/consume/egg_energy_team_assistance_consume.go b/consume/egg_energy_team_assistance_consume.go index 0e07f23..7438555 100644 --- a/consume/egg_energy_team_assistance_consume.go +++ b/consume/egg_energy_team_assistance_consume.go @@ -68,7 +68,7 @@ func handleEggEnergyTeamAssistanceDataConsume(msgData []byte) error { session := db.Db.NewSession() defer session.Close() callbackDb := implement.NewAdvertisingCallbackDb(db.Db) - exist, err := callbackDb.AdvertisingCallbackExistBySession(session, utils2.Int64ToStr(msg.AssistanceUid), msg.SignStart, msg.SignEnd, "") + count, err := callbackDb.AdvertisingCallbackCountBySession(session, utils2.Int64ToStr(msg.AssistanceUid), msg.SignStart, msg.SignEnd, "") if err != nil { return err } @@ -97,7 +97,8 @@ func handleEggEnergyTeamAssistanceDataConsume(msgData []byte) error { } } else { teamAssistance.RewardScore = utils2.Float64ToStr(msg.AssistanceValue + utils2.StrToFloat64(teamAssistance.RewardScore)) - if !exist { + // 如果是第一条说明还没有被记录过, 助力人数 + 1 + if count == 1 { teamAssistance.AssistedNum++ } _, err = assistanceDb.EggEnergyTeamAssistanceUpdateBySession(session, teamAssistance.Id, teamAssistance, "assisted_num", "reward_score") diff --git a/go.mod b/go.mod index 2d23a31..757804b 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ go 1.19 //replace code.fnuoos.com/EggPlanet/egg_system_rules.git => E:/company/Egg/egg_system_rules require ( - code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241219061302-9c0299d2292a + code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241219063536-340ce34a0fa9 code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241219043645-3f6b3590ae75 code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5