From d0b5c96f23f62a983f4bb5bbb113856ac0bd9811 Mon Sep 17 00:00:00 2001 From: jiayuqi7813 <63686458+jiayuqi7813@users.noreply.github.com> Date: Mon, 27 Jun 2022 20:14:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E7=94=A8=E6=88=B7api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/user.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/user.go b/api/user.go index ac73996..bebaa41 100644 --- a/api/user.go +++ b/api/user.go @@ -209,14 +209,14 @@ func GetAllUserInfo(c *gin.Context) { var alla []PublicAllInfoResponse Link() DB := db.DBsnctf - rows, err := DB.Debug().Select([]string{"id", "username", "affiliation", "country", "website", "hidden"}).Table("user").Rows() + rows, err := DB.Debug().Select([]string{"id", "username", "affiliation", "country", "website"}).Table("user").Where("hidden = ?", 0).Rows() if err != nil { c.JSON(400, gin.H{"code": 400, "msg": "Get info error!"}) return } for rows.Next() { - rows.Scan(&info.Id, &info.Username, &info.Affiliation, &info.Country, &info.Website, &info.Hidden) + rows.Scan(&info.Id, &info.Username, &info.Affiliation, &info.Country, &info.Website) alla = append(alla, info) } c.JSON(200, gin.H{"code": 200, "data": alla})