This commit is contained in:
yangduo 2024-08-23 15:01:17 +08:00
parent c8187f971e
commit 4d2fc95ed0

View File

@ -10,7 +10,7 @@ import (
type accountContribution struct { type accountContribution struct {
history float64 history float64
// loadhistory bool stakingContri float64
gamecontribution float64 gamecontribution float64
rechargeContri float64 rechargeContri float64
gcTime int64 gcTime int64
@ -19,7 +19,7 @@ type accountContribution struct {
} }
func (ac *accountContribution) sum() float64 { func (ac *accountContribution) sum() float64 {
return ac.history + ac.gamecontribution + ac.rechargeContri return ac.history + ac.stakingContri + ac.gamecontribution + ac.rechargeContri
} }
type contribution struct { type contribution struct {
@ -149,9 +149,7 @@ func (this *contribution) GetAddressContribution(accountAddress string, onlyrech
} }
} }
// if !(*accinfo).loadhistory
{ {
(*accinfo).history = 0
sql := `SELECT contribution FROM t_contribution WHERE idx > 0 and account_address = ?` sql := `SELECT contribution FROM t_contribution WHERE idx > 0 and account_address = ?`
f5.GetGoStyleDb().RawQuery( f5.GetGoStyleDb().RawQuery(
constant.BCNFT_DB, constant.BCNFT_DB,
@ -178,12 +176,9 @@ func (this *contribution) GetAddressContribution(accountAddress string, onlyrech
} }
if ds.Next() { if ds.Next() {
tmp, _ := q5.ToFloat64Ex(ds.GetByIndex(0)) (*accinfo).stakingContri, _ = q5.ToFloat64Ex(ds.GetByIndex(0))
(*accinfo).history += tmp
} }
}) })
// (*accinfo).loadhistory = true
} }
if (*accinfo).accountid != "" { if (*accinfo).accountid != "" {