package models import ( "time" "github.com/ouxuanserver/osmanthuswine/src/core" ) const BSWalletTableName = TableNamePrefix + "bully_screen_wallet" type BullyScreenWallet struct { Id int `json:"id" xorm:"not null pk autoincr INT(11)"` CustomerId int `json:"customer_id"` Balance float64 `json:"balance"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } func (t *BullyScreenWallet) TableName() string { return BSWalletTableName } func (t *BullyScreenWallet) IncrBalance(cid int, money float64) (int64, error) { return core.GetXormAuto().Where("customer_id=?", cid). Incr("balance", money).Cols("balance").Update(t) }