1
This commit is contained in:
parent
343547ab9d
commit
1ba85d892e
@ -18,7 +18,6 @@ func (this *vip) Add(accountAddress string, val string, idx int64, valField stri
|
||||
return this.AddEx(accountAddress, val, idx, valField, idxField, [][]string{})
|
||||
}
|
||||
|
||||
|
||||
func (this *vip) AddEx(accountAddress string, val string, idx int64, valField string, idxField string,
|
||||
whereKv [][]string) bool {
|
||||
this.lock.Lock()
|
||||
@ -34,6 +33,18 @@ func (this *vip) AddEx(accountAddress string, val string, idx int64, valField st
|
||||
return false
|
||||
}
|
||||
nowTime := f5.GetApp().GetRealSeconds()
|
||||
updateKv := [][]string {
|
||||
{valField, val},
|
||||
{idxField, q5.ToString(idx)},
|
||||
{"modifytime", q5.ToString(nowTime)},
|
||||
}
|
||||
insertKv := [][]string {
|
||||
{"account_address", accountAddress},
|
||||
{valField, val},
|
||||
{idxField, q5.ToString(idx)},
|
||||
{"createtime", q5.ToString(nowTime)},
|
||||
{"modifytime", q5.ToString(nowTime)},
|
||||
}
|
||||
if ds.Next() {
|
||||
if q5.ToInt64(ds.GetByName(idxField)) <= idx {
|
||||
return true
|
||||
@ -44,13 +55,7 @@ func (this *vip) AddEx(accountAddress string, val string, idx int64, valField st
|
||||
[][]string {
|
||||
{"address", accountAddress},
|
||||
},
|
||||
[][]string {
|
||||
{"account_address", accountAddress},
|
||||
{valField, val},
|
||||
{idxField, q5.ToString(idx)},
|
||||
{"createtime", q5.ToString(nowTime)},
|
||||
{"modifytime", q5.ToString(nowTime)},
|
||||
})
|
||||
updateKv)
|
||||
if err1 != nil {
|
||||
return false
|
||||
}
|
||||
@ -58,13 +63,7 @@ func (this *vip) AddEx(accountAddress string, val string, idx int64, valField st
|
||||
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)},
|
||||
})
|
||||
insertKv)
|
||||
if err1 != nil {
|
||||
return false
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user