调整,质押继续有收益

This commit is contained in:
yangduo 2024-08-23 14:33:42 +08:00
parent e0c06c8b01
commit c8187f971e
2 changed files with 24 additions and 20 deletions

View File

@ -60,24 +60,26 @@ func (cta *ContriApi) HistoryQuery(c *gin.Context) {
{ {
loweremail, accountid := service.Contribution.GetEmailAccountId(account) loweremail, accountid := service.Contribution.GetEmailAccountId(account)
sql := `SELECT * FROM t_contribution_history WHERE idx > 0 AND account_id = ?` if accountid != "" {
f5.GetGoStyleDb().RawQuery( sql = `SELECT * FROM t_contribution_history WHERE idx > 0 AND account_id = ?`
constant.GAME_DB, f5.GetGoStyleDb().RawQuery(
sql, constant.GAME_DB,
[]string{accountid}, sql,
func(err error, ds *f5.DataSet) { []string{accountid},
if err != nil { func(err error, ds *f5.DataSet) {
return if err != nil {
} return
}
for ds.Next() { for ds.Next() {
p := new(info) p := new(info)
p.Type = 2 p.Type = 2
p.Time = q5.SafeToInt32(ds.GetByName("createtime")) p.Time = q5.SafeToInt32(ds.GetByName("createtime"))
p.CP = fmt.Sprintf("%.2f", q5.ToFloat64(ds.GetByName("contribution"))) p.CP = fmt.Sprintf("%.2f", q5.ToFloat64(ds.GetByName("contribution")))
q5.AppendSlice(&rspObj.Rows, p) q5.AppendSlice(&rspObj.Rows, p)
} }
}) })
}
sql = `SELECT * FROM t_recharge_return_contribution WHERE idx > 0 AND user_identity IN (?` sql = `SELECT * FROM t_recharge_return_contribution WHERE idx > 0 AND user_identity IN (?`

View File

@ -10,7 +10,7 @@ import (
type accountContribution struct { type accountContribution struct {
history float64 history float64
loadhistory bool // loadhistory bool
gamecontribution float64 gamecontribution float64
rechargeContri float64 rechargeContri float64
gcTime int64 gcTime int64
@ -149,7 +149,9 @@ func (this *contribution) GetAddressContribution(accountAddress string, onlyrech
} }
} }
if !(*accinfo).loadhistory { // 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,
@ -181,7 +183,7 @@ func (this *contribution) GetAddressContribution(accountAddress string, onlyrech
} }
}) })
(*accinfo).loadhistory = true // (*accinfo).loadhistory = true
} }
if (*accinfo).accountid != "" { if (*accinfo).accountid != "" {