diff --git a/server/marketserver/api/v1/vip/vip.go b/server/marketserver/api/v1/vip/vip.go index 57725089..4847a427 100644 --- a/server/marketserver/api/v1/vip/vip.go +++ b/server/marketserver/api/v1/vip/vip.go @@ -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)