This commit is contained in:
aozhiwei 2024-09-04 10:39:18 +08:00
parent 3330cfdee4
commit 10621db90a

View File

@ -141,6 +141,7 @@ func (this *stackingCec) apply(idx int64, eventName string,
return false
}
srcAmount := "0"
srcGrowthValue := "0"
{
dbErr, ds := f5.GetGoStyleDb().NewOrmSelect(
constant.BCNFT_DB,
@ -158,12 +159,17 @@ func (this *stackingCec) apply(idx int64, eventName string,
return true
}
srcAmount = ds.GetByName("amount")
srcGrowthValue = ds.GetByName("growth_value")
}
}
bnNewAmount, ok := new(big.Int).SetString(srcAmount, 10)
if !ok {
return false
}
bnNewGrowthValue, ok := new(big.Int).SetString(srcGrowthValue, 10)
if !ok {
return false
}
bnNewAmount.Add(bnNewAmount, bnAmount)
{
nowTime := f5.GetApp().GetRealSeconds()
@ -184,7 +190,7 @@ func (this *stackingCec) apply(idx int64, eventName string,
{"token_address", strings.ToLower(p.Token)},
{"amount", bnNewAmount.String()},
{"last_apply_record_idx", q5.ToString(idx)},
{"growth_value", q5.ToString(0)},
{"growth_value", bnNewGrowthValue.String()},
{"growth_value_int64", q5.ToString(0)},
{"vip_lv", q5.ToString(0)},
{"createtime", q5.ToString(nowTime)},