Fixed a bug where it was not possible to reset coins

This commit is contained in:
kolaente 2019-09-11 19:22:04 +02:00
parent ac64aa2539
commit 7f0d1f2ea1
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 9 additions and 3 deletions

View File

@ -62,7 +62,10 @@ func (c *Community) Update(moreCoins int64) (err error) {
c.KCoins += moreCoins
// Update
_, err = x.Where("id = ?", c.ID).Update(c)
_, err = x.
Cols("k_coins").
Where("id = ?", c.ID).
Update(c)
if err != nil {
return
}

View File

@ -19,7 +19,7 @@ func DBinit() {
}
x.SetMapper(core.GonicMapper{})
x.ShowSQL(false)
x.ShowSQL(true)
x.Logger().SetLevel(core.LOG_DEBUG)
x.Sync(&Kofi{}, &Community{})

View File

@ -34,7 +34,10 @@ func (k *Kofi) Update(moreCoins int64) (err error) {
k.KCoins += moreCoins
// Update
_, err = x.Where("id = ?", k.ID).Update(k)
_, err = x.
Cols("k_coins").
Where("id = ?", k.ID).
Update(k)
return
}