Fix: Commander db name in types
This commit is contained in:
parent
dbcf5decb8
commit
8db4870057
2 changed files with 3 additions and 2 deletions
|
@ -256,6 +256,7 @@ func updateEloCommanderWithLastMatch(e *core.RecordEvent, commanderId string, da
|
||||||
AndWhere(dbx.Or(dbx.NewExp("commandant_1 = {:id}", dbx.Params{"id": commanderId}), dbx.NewExp("commandant_2 = {:id}", dbx.Params{"id": commanderId}))).
|
AndWhere(dbx.Or(dbx.NewExp("commandant_1 = {:id}", dbx.Params{"id": commanderId}), dbx.NewExp("commandant_2 = {:id}", dbx.Params{"id": commanderId}))).
|
||||||
OrderBy("date DESC").
|
OrderBy("date DESC").
|
||||||
One(&lastMatch)
|
One(&lastMatch)
|
||||||
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
// If a match exists before this one update ELO
|
// If a match exists before this one update ELO
|
||||||
if lastMatch.Commander1 == commanderId {
|
if lastMatch.Commander1 == commanderId {
|
||||||
|
|
|
@ -61,8 +61,8 @@ type Elo struct {
|
||||||
Date string `db:"date" json:"date"`
|
Date string `db:"date" json:"date"`
|
||||||
Player1 string `db:"player_1" json:"player_1"`
|
Player1 string `db:"player_1" json:"player_1"`
|
||||||
Player2 string `db:"player_2" json:"player_2"`
|
Player2 string `db:"player_2" json:"player_2"`
|
||||||
Commander1 string `db:"commander_1" json:"commander_1"`
|
Commander1 string `db:"commandant_1" json:"commander_1"`
|
||||||
Commander2 string `db:"commander_2" json:"commander_2"`
|
Commander2 string `db:"commandant_2" json:"commander_2"`
|
||||||
Score1 int `db:"score_1" json:"score_1"`
|
Score1 int `db:"score_1" json:"score_1"`
|
||||||
Score2 int `db:"score_2" json:"score_2"`
|
Score2 int `db:"score_2" json:"score_2"`
|
||||||
Official bool `db:"official" json:"official"`
|
Official bool `db:"official" json:"official"`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue