fix: game7 user not exist role bug

This commit is contained in:
lianghuanjie
2025-01-17 21:08:18 +08:00
parent b9c369c4d8
commit 7cc62b8b4f
2 changed files with 15 additions and 8 deletions

View File

@@ -48,10 +48,14 @@ GROUP BY
`
var resp GameReport
err := m.conn.QueryRowCtx(ctx, &resp, query, email)
if err != nil && !errors.Is(err, sqlx.ErrNotFound) {
switch {
case err == nil:
return &resp, nil
case errors.Is(err, sqlx.ErrNotFound):
return nil, ErrNotFound
default:
return nil, err
}
return &resp, nil
}
// NewNhGameReportModel returns a model for the database table.