1
This commit is contained in:
parent
612a01f38b
commit
7b345d134b
@ -140,28 +140,47 @@ func (this *stackingCec) apply(idx int64, eventName string,
|
|||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
dbErr, ds := f5.GetGoStyleDb().NewOrmSelect(
|
|
||||||
constant.BCNFT_DB,
|
|
||||||
"t_staking_cec",
|
|
||||||
[][]string{
|
|
||||||
{"account_address", strings.ToLower(p.Account)},
|
|
||||||
{"token_address", strings.ToLower(p.Token)},
|
|
||||||
},
|
|
||||||
)
|
|
||||||
if dbErr != nil {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
srcAmount := "0"
|
srcAmount := "0"
|
||||||
if ds.Next() {
|
{
|
||||||
if idx <= q5.ToInt64(ds.GetByName("last_apply_record_idx")) {
|
dbErr, ds := f5.GetGoStyleDb().NewOrmSelect(
|
||||||
return true
|
constant.BCNFT_DB,
|
||||||
|
"t_staking_cec",
|
||||||
|
[][]string{
|
||||||
|
{"account_address", strings.ToLower(p.Account)},
|
||||||
|
{"token_address", strings.ToLower(p.Token)},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
if dbErr != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if ds.Next() {
|
||||||
|
if idx <= q5.ToInt64(ds.GetByName("last_apply_record_idx")) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
srcAmount = ds.GetByName("amount")
|
||||||
}
|
}
|
||||||
srcAmount = ds.GetByName("amount")
|
|
||||||
}
|
}
|
||||||
bnNewAmount, ok := new(big.Int).SetString(srcAmount, 10)
|
bnNewAmount, ok := new(big.Int).SetString(srcAmount, 10)
|
||||||
if !ok {
|
if !ok {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
bnNewAmount.Add(bnNewAmount, bnAmount)
|
bnNewAmount.Add(bnNewAmount, bnAmount)
|
||||||
return true
|
{
|
||||||
|
nowTime := f5.GetApp().GetRealSeconds()
|
||||||
|
dbErr, _, _ := f5.GetGoStyleDb().NewUpsert(
|
||||||
|
constant.BCNFT_DB,
|
||||||
|
"t_staking_cec",
|
||||||
|
[][]string{
|
||||||
|
{"account_address", strings.ToLower(p.Account)},
|
||||||
|
{"token_address", strings.ToLower(p.Token)},
|
||||||
|
},
|
||||||
|
[][]string{},
|
||||||
|
[][]string{
|
||||||
|
{"account_address", strings.ToLower(p.Account)},
|
||||||
|
{"token_address", strings.ToLower(p.Token)},
|
||||||
|
{"createtime", q5.ToString(nowTime)},
|
||||||
|
{"modifytime", q5.ToString(nowTime)},
|
||||||
|
})
|
||||||
|
return dbErr == nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user