Merge branch 'songquanpeng:main' into main

This commit is contained in:
Calcium-Ion
2023-10-30 16:12:09 +08:00
committed by GitHub
19 changed files with 99 additions and 45 deletions

View File

@@ -269,7 +269,12 @@ func GetUserEmail(id int) (email string, err error) {
}
func GetUserGroup(id int) (group string, err error) {
err = DB.Model(&User{}).Where("id = ?", id).Select("`group`").Find(&group).Error
groupCol := "`group`"
if common.UsingPostgreSQL {
groupCol = `"group"`
}
err = DB.Model(&User{}).Where("id = ?", id).Select(groupCol).Find(&group).Error
return group, err
}