瀏覽代碼

fix assisted num

master
shenjiachi 3 天之前
父節點
當前提交
2067808705
共有 2 個檔案被更改,包括 4 行新增3 行删除
  1. +3
    -2
      consume/egg_energy_team_assistance_consume.go
  2. +1
    -1
      go.mod

+ 3
- 2
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")


+ 1
- 1
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


Loading…
取消
儲存