Skip to content

Commit

Permalink
fix: 修正使用First的情况下,查询会导致提示报错的问题 (#1190)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaienNate authored Jan 12, 2025
1 parent 23b8ab8 commit 62b7222
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dice/model/group_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ func GroupPlayerInfoGet(db *gorm.DB, groupID string, playerID string) *GroupPlay
result := db.Model(&GroupPlayerInfoBase{}).
Where("group_id = ? AND user_id = ?", groupID, playerID).
Select("name, last_command_time, auto_set_name_template, dice_side_num").
First(&ret)
Limit(1).
Find(&ret)
err := result.Error
// 如果查询发生错误,打印错误并返回 nil
if err != nil {
Expand Down

0 comments on commit 62b7222

Please sign in to comment.