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