This commit is contained in:
aozhiwei 2024-09-23 15:59:47 +08:00
parent 1ba85d892e
commit aa46f48fe7

View File

@ -4,6 +4,7 @@ import (
"q5" "q5"
"f5" "f5"
"sync" "sync"
"strings"
"main/constant" "main/constant"
) )
@ -19,10 +20,11 @@ func (this *vip) Add(accountAddress string, val string, idx int64, valField stri
} }
func (this *vip) AddEx(accountAddress string, val string, idx int64, valField string, idxField string, func (this *vip) AddEx(accountAddress string, val string, idx int64, valField string, idxField string,
whereKv [][]string) bool { extKv [][]string) bool {
this.lock.Lock() this.lock.Lock()
defer this.lock.Unlock() defer this.lock.Unlock()
accountAddress = strings.ToLower(accountAddress)
err, ds := f5.GetGoStyleDb().NewOrmSelect( err, ds := f5.GetGoStyleDb().NewOrmSelect(
constant.BCNFT_DB, constant.BCNFT_DB,
"t_vip_user", "t_vip_user",
@ -45,6 +47,8 @@ func (this *vip) AddEx(accountAddress string, val string, idx int64, valField st
{"createtime", q5.ToString(nowTime)}, {"createtime", q5.ToString(nowTime)},
{"modifytime", q5.ToString(nowTime)}, {"modifytime", q5.ToString(nowTime)},
} }
updateKv = append(updateKv, extKv...)
insertKv = append(insertKv, extKv...)
if ds.Next() { if ds.Next() {
if q5.ToInt64(ds.GetByName(idxField)) <= idx { if q5.ToInt64(ds.GetByName(idxField)) <= idx {
return true return true