From 2b1ceec5765fecf13fcc7800f3035f2a7096ee86 Mon Sep 17 00:00:00 2001 From: yangduo Date: Mon, 23 Sep 2024 14:04:58 +0800 Subject: [PATCH] fix --- server/marketserver/service/contribution.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/server/marketserver/service/contribution.go b/server/marketserver/service/contribution.go index 7c2b6913..4f173123 100644 --- a/server/marketserver/service/contribution.go +++ b/server/marketserver/service/contribution.go @@ -19,11 +19,12 @@ type accountContribution struct { } func (ac *accountContribution) sum() float64 { - return ac.history + ac.stakingContri + ac.gamecontribution + ac.rechargeContri + return ac.history + ac.stakingContri + ac.gamecontribution + ac.rechargeContri } type contribution struct { historyContribution float64 + stakingContribution float64 rechargeContribution float64 gameContribution float64 gcTime int64 @@ -44,7 +45,7 @@ func (this *contribution) unInit() { } func (c *contribution) sum() float64 { - return c.historyContribution + c.rechargeContribution + c.gameContribution + return c.historyContribution + c.stakingContribution + c.rechargeContribution + c.gameContribution } func (this *contribution) GetEmailContributionAccountid(email string) (float64, string, error) { @@ -252,8 +253,10 @@ func (this *contribution) GetGlobalContribution(instant bool) (float64, error) { this.historyContribution, _ = q5.ToFloat64Ex(ds.GetByIndex(0)) } }) + } - sql = `SELECT SUM(contribution) FROM t_staking_daily_settlement WHERE idx > 0` + if nowseconds := f5.GetApp().GetRealSeconds(); nowseconds > this.gcTime+60 || instant { + sql := `SELECT SUM(contribution) FROM t_staking_daily_settlement WHERE idx > 0` f5.GetGoStyleDb().RawQuery( constant.BCNFT_DB, sql, @@ -264,14 +267,11 @@ func (this *contribution) GetGlobalContribution(instant bool) (float64, error) { } if ds.Next() { - tmp, _ := q5.ToFloat64Ex(ds.GetByIndex(0)) - this.historyContribution += tmp + this.stakingContribution, _ = q5.ToFloat64Ex(ds.GetByIndex(0)) } }) - } - if nowseconds := f5.GetApp().GetRealSeconds(); nowseconds > this.gcTime+60 || instant { - sql := `SELECT SUM(contribution) FROM t_contribution WHERE idx > 0` + sql = `SELECT SUM(contribution) FROM t_contribution WHERE idx > 0` f5.GetGoStyleDb().RawQuery( constant.GAME_DB, sql,