nil return modify

This commit is contained in:
Gordon
2021-12-29 18:09:55 +08:00
parent 6f03c470ae
commit abd91260ab
2 changed files with 7 additions and 6 deletions
@@ -112,10 +112,10 @@ func SelectSomeUserID(userIDList []string) ([]string, error) {
if err != nil {
return nil, err
}
var userList []User
err = dbConn.Table("user").Where("(user_id) IN ? ", userIDList).Find(&userList).Error
var resultArr []string
err = dbConn.Table("user").Where("(user_id) IN ? ", userIDList).Pluck("user_id", &resultArr).Error
if err != nil {
return nil, err
}
return userIDList, nil
return resultArr, nil
}