diff --git a/server/light_backtask/service/vip.go b/server/light_backtask/service/vip.go index 75c61ea2..08278147 100644 --- a/server/light_backtask/service/vip.go +++ b/server/light_backtask/service/vip.go @@ -14,6 +14,7 @@ type vip struct { } type vesterDepositWithdrawPo struct { + idx int64 eventName string chainTimestamp int32 accountAddress string @@ -106,11 +107,12 @@ func (this *vip) RecalcEsCecConvert(accountAddress string) error { return err } matchDeposits := []*vesterDepositWithdrawPo{} + var lastWithdraw *vesterDepositWithdrawPo { - var lastWithdraw *vesterDepositWithdrawPo allDeposits := []*vesterDepositWithdrawPo{} for ds.Next() { p := new(vesterDepositWithdrawPo) + p.idx = q5.ToInt64(ds.GetByName("event_name")) p.eventName = ds.GetByName("event_name") p.chainTimestamp = q5.ToInt32(ds.GetByName("chain_timestamp")) p.accountAddress = ds.GetByName("account_address") @@ -151,5 +153,14 @@ func (this *vip) RecalcEsCecConvert(accountAddress string) error { bnTotal = bnAmount.Add(bnAmount, bnTotal) lastDeposit = val } + var maxIdx int64 + if lastDeposit != nil && + lastDeposit.idx > maxIdx { + maxIdx = lastDeposit.idx + } + if lastWithdraw != nil && + lastWithdraw.idx > maxIdx { + maxIdx = lastWithdraw.idx + } return nil }