调整
This commit is contained in:
parent
bcfba92459
commit
373eab8762
@ -167,7 +167,6 @@ func (this *VIPApi) Details(c *gin.Context) {
|
|||||||
|
|
||||||
{
|
{
|
||||||
var dbErr error
|
var dbErr error
|
||||||
found := false
|
|
||||||
sql := "SELECT * FROM t_vip_user WHERE account_address = ?"
|
sql := "SELECT * FROM t_vip_user WHERE account_address = ?"
|
||||||
params := []string{
|
params := []string{
|
||||||
accountAddress,
|
accountAddress,
|
||||||
@ -183,7 +182,6 @@ func (this *VIPApi) Details(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ds.Next() {
|
if ds.Next() {
|
||||||
found = true
|
|
||||||
rspObj.Info.Level = q5.SafeToInt32(ds.GetByName("vip_lv"))
|
rspObj.Info.Level = q5.SafeToInt32(ds.GetByName("vip_lv"))
|
||||||
cfg := mt.Table.StakingVip.GetById(q5.SafeToInt64(rspObj.Info.Level))
|
cfg := mt.Table.StakingVip.GetById(q5.SafeToInt64(rspObj.Info.Level))
|
||||||
if cfg != nil {
|
if cfg != nil {
|
||||||
@ -222,6 +220,13 @@ func (this *VIPApi) Details(c *gin.Context) {
|
|||||||
rspObj.Info.Cur = cfg.GetThisPoint() * (convercurExec - cfg.GetRequire()) / (nextlvcfg.GetRequire() - cfg.GetRequire())
|
rspObj.Info.Cur = cfg.GetThisPoint() * (convercurExec - cfg.GetRequire()) / (nextlvcfg.GetRequire() - cfg.GetRequire())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
rspObj.Info.Level = 0
|
||||||
|
rspObj.Info.Cur = 0
|
||||||
|
cfg := mt.Table.StakingVip.GetById(q5.SafeToInt64(0))
|
||||||
|
if cfg != nil {
|
||||||
|
rspObj.Info.Target = cfg.GetThisPoint()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -229,11 +234,6 @@ func (this *VIPApi) Details(c *gin.Context) {
|
|||||||
f5.RspErr(c, 500, "server internal error")
|
f5.RspErr(c, 500, "server internal error")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !found {
|
|
||||||
f5.RspErr(c, 1, "not vip")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(200, rspObj)
|
c.JSON(200, rspObj)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user