1
This commit is contained in:
parent
15b20c0b89
commit
8e7e007613
@ -5,6 +5,7 @@ import (
|
||||
"f5"
|
||||
"sync"
|
||||
"main/constant"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
type vip struct {
|
||||
@ -29,7 +30,24 @@ func (this *vip) Add(accountAddress string, val string, idx int64, valField stri
|
||||
}
|
||||
nowTime := f5.GetApp().GetRealSeconds()
|
||||
if ds.Next() {
|
||||
|
||||
bnTotal, ok := new(big.Int).SetString(ds.GetByName("escec_total"), 10)
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
err1, _, _ := f5.GetGoStyleDb().NewInsert(
|
||||
constant.BCNFT_DB,
|
||||
"t_vip_user",
|
||||
[][]string {
|
||||
{"account_address", accountAddress},
|
||||
{valField, val},
|
||||
{idxField, q5.ToString(idx)},
|
||||
{"escec_total", bnTotal.String()},
|
||||
{"createtime", q5.ToString(nowTime)},
|
||||
{"modifytime", q5.ToString(nowTime)},
|
||||
})
|
||||
if err1 != nil {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
err1, _, _ := f5.GetGoStyleDb().NewInsert(
|
||||
constant.BCNFT_DB,
|
||||
@ -38,6 +56,7 @@ func (this *vip) Add(accountAddress string, val string, idx int64, valField stri
|
||||
{"account_address", accountAddress},
|
||||
{valField, val},
|
||||
{idxField, q5.ToString(idx)},
|
||||
{"escec_total", val},
|
||||
{"createtime", q5.ToString(nowTime)},
|
||||
{"modifytime", q5.ToString(nowTime)},
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user