🐛 Fix get user info query statement bug

This commit is contained in:
2024-11-17 01:05:11 +08:00
parent 4695a617d7
commit 8e1ed67c48
2 changed files with 5 additions and 5 deletions

View File

@ -15,11 +15,11 @@ import (
func getOtherUserinfo(c *fiber.Ctx) error {
alias := c.Params("alias")
tx := database.C.Where("name = ?")
tx := database.C.Where("name = ?", alias)
numericId, err := strconv.Atoi(alias)
if err == nil {
tx = tx.Where("id = ?", numericId)
tx = tx.Or("id = ?", numericId)
}
var account models.Account