This commit is contained in:
aozhiwei 2024-09-18 19:15:16 +08:00
parent a45233ee8b
commit 15b20c0b89

View File

@ -1,6 +1,7 @@
package service
import (
"q5"
"f5"
"sync"
"main/constant"
@ -13,7 +14,7 @@ type vip struct {
func (this *vip) init() () {
}
func (this *vip) Add(accountAddress string, val string, valField string, idxField string) bool {
func (this *vip) Add(accountAddress string, val string, idx int64, valField string, idxField string) bool {
this.lock.Lock()
defer this.lock.Unlock()
@ -26,10 +27,23 @@ func (this *vip) Add(accountAddress string, val string, valField string, idxFiel
if err != nil {
return false
}
nowTime := f5.GetApp().GetRealSeconds()
if ds.Next() {
} else {
err1, _, _ := f5.GetGoStyleDb().NewInsert(
constant.BCNFT_DB,
"t_vip_user",
[][]string {
{"account_address", accountAddress},
{valField, val},
{idxField, q5.ToString(idx)},
{"createtime", q5.ToString(nowTime)},
{"modifytime", q5.ToString(nowTime)},
})
if err1 != nil {
return false
}
}
return false
}