diff --git a/server/marketserver/api/v1/activity/contribution.go b/server/marketserver/api/v1/activity/contribution.go index ddd47f04..d78f8560 100644 --- a/server/marketserver/api/v1/activity/contribution.go +++ b/server/marketserver/api/v1/activity/contribution.go @@ -60,24 +60,26 @@ func (cta *ContriApi) HistoryQuery(c *gin.Context) { { loweremail, accountid := service.Contribution.GetEmailAccountId(account) - sql := `SELECT * FROM t_contribution_history WHERE idx > 0 AND account_id = ?` - f5.GetGoStyleDb().RawQuery( - constant.GAME_DB, - sql, - []string{accountid}, - func(err error, ds *f5.DataSet) { - if err != nil { - return - } + if accountid != "" { + sql = `SELECT * FROM t_contribution_history WHERE idx > 0 AND account_id = ?` + f5.GetGoStyleDb().RawQuery( + constant.GAME_DB, + sql, + []string{accountid}, + func(err error, ds *f5.DataSet) { + if err != nil { + return + } - for ds.Next() { - p := new(info) - p.Type = 2 - p.Time = q5.SafeToInt32(ds.GetByName("createtime")) - p.CP = fmt.Sprintf("%.2f", q5.ToFloat64(ds.GetByName("contribution"))) - q5.AppendSlice(&rspObj.Rows, p) - } - }) + for ds.Next() { + p := new(info) + p.Type = 2 + p.Time = q5.SafeToInt32(ds.GetByName("createtime")) + p.CP = fmt.Sprintf("%.2f", q5.ToFloat64(ds.GetByName("contribution"))) + q5.AppendSlice(&rspObj.Rows, p) + } + }) + } sql = `SELECT * FROM t_recharge_return_contribution WHERE idx > 0 AND user_identity IN (?` diff --git a/server/marketserver/service/contribution.go b/server/marketserver/service/contribution.go index 202920ca..8f6bd1a3 100644 --- a/server/marketserver/service/contribution.go +++ b/server/marketserver/service/contribution.go @@ -10,7 +10,7 @@ import ( type accountContribution struct { history float64 - loadhistory bool + // loadhistory bool gamecontribution float64 rechargeContri float64 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 = ?` f5.GetGoStyleDb().RawQuery( constant.BCNFT_DB, @@ -181,7 +183,7 @@ func (this *contribution) GetAddressContribution(accountAddress string, onlyrech } }) - (*accinfo).loadhistory = true + // (*accinfo).loadhistory = true } if (*accinfo).accountid != "" {