Fixed a bug where it was not possible to reset coins
This commit is contained in:
parent
ac64aa2539
commit
7f0d1f2ea1
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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{})
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue