This commit is contained in:
aozhiwei 2024-09-23 15:19:55 +08:00
parent e8a519ca8f
commit 6e8e2ee634
2 changed files with 6 additions and 17 deletions

View File

@ -5,7 +5,6 @@ import (
"f5"
"sync"
"main/constant"
"math/big"
)
type vip struct {
@ -24,7 +23,7 @@ func (this *vip) Add(accountAddress string, val string, idx int64, valField stri
"t_vip_user",
[][]string {
{"address", accountAddress},
})
})
if err != nil {
return false
}
@ -33,25 +32,16 @@ func (this *vip) Add(accountAddress string, val string, idx int64, valField stri
if q5.ToInt64(ds.GetByName(idxField)) <= idx {
return true
}
bnVal, ok := new(big.Int).SetString(val, 10)
if !ok {
f5.GetSysLog().Info("vip.Add val to bigint error:%s", val)
return false
}
bnTotal, ok := new(big.Int).SetString(ds.GetByName("escec_total"), 10)
if !ok {
f5.GetSysLog().Info("vip.Add escec_total to bigint error:%s", val)
return false
}
bnTotal = bnTotal.Add(bnTotal, bnVal)
err1, _, _ := f5.GetGoStyleDb().NewInsert(
err1, _, _ := f5.GetGoStyleDb().NewUpdate(
constant.BCNFT_DB,
"t_vip_user",
[][]string {
{"address", accountAddress},
},
[][]string {
{"account_address", accountAddress},
{valField, val},
{idxField, q5.ToString(idx)},
{"escec_total", bnTotal.String()},
{"createtime", q5.ToString(nowTime)},
{"modifytime", q5.ToString(nowTime)},
})
@ -66,7 +56,6 @@ 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)},
})

2
third_party/f5 vendored

@ -1 +1 @@
Subproject commit fe1b7e21eb37d5494ccf32347ff368a1f011ac02
Subproject commit 5f03fcf1abe7511c7ad93b6cd1a03f61cb4dce9a