This commit is contained in:
yangduo 2024-09-26 14:38:17 +08:00
parent bcfba92459
commit 373eab8762

View File

@ -167,7 +167,6 @@ func (this *VIPApi) Details(c *gin.Context) {
{
var dbErr error
found := false
sql := "SELECT * FROM t_vip_user WHERE account_address = ?"
params := []string{
accountAddress,
@ -183,7 +182,6 @@ func (this *VIPApi) Details(c *gin.Context) {
}
if ds.Next() {
found = true
rspObj.Info.Level = q5.SafeToInt32(ds.GetByName("vip_lv"))
cfg := mt.Table.StakingVip.GetById(q5.SafeToInt64(rspObj.Info.Level))
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())
}
}
} 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")
return
}
if !found {
f5.RspErr(c, 1, "not vip")
return
}
}
c.JSON(200, rspObj)