mirror of
https://github.com/genxium/DelayNoMore
synced 2025-10-09 08:36:52 +00:00
Minor fix.
This commit is contained in:
@@ -77,13 +77,14 @@ func getPlayer(cond sq.Eq) (*Player, error) {
|
||||
return nil, err
|
||||
}
|
||||
rows, err := storage.MySQLManagerIns.Queryx(query, args...)
|
||||
if err != nil {
|
||||
if nil != err {
|
||||
return nil, err
|
||||
}
|
||||
cols, err := rows.Columns()
|
||||
if nil != err {
|
||||
panic(err)
|
||||
}
|
||||
cnt := 0
|
||||
for rows.Next() {
|
||||
// TODO: Do it more elegantly, but by now I don't have time to learn reflection of Golang
|
||||
vals := rowValues(rows, cols)
|
||||
@@ -105,9 +106,14 @@ func getPlayer(cond sq.Eq) (*Player, error) {
|
||||
}
|
||||
}
|
||||
Logger.Debug("Queried player from db", zap.Any("cond", cond), zap.Any("p", p), zap.Any("pd", pd), zap.Any("cols", cols), zap.Any("rowValues", vals))
|
||||
cnt++
|
||||
}
|
||||
if 0 < cnt {
|
||||
p.PlayerDownsync = pd
|
||||
return &p, nil
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
p.PlayerDownsync = pd
|
||||
return &p, nil
|
||||
}
|
||||
|
||||
func (p *Player) Insert(tx *sqlx.Tx) error {
|
||||
|
Reference in New Issue
Block a user