package models import ( "github.com/ouxuanserver/osmanthuswine/src/core" "time" ) const BSWalletTableName = TableNamePrefix + "bully_screen_wallet" type BullyScreenWallet struct { Id int64 `json:"id"` CustomerId int64 `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 int64, money float64) (int64, error) { return core.GetXormAuto().Where("customer_id=?", cid). Incr("balance", money).Cols("balance").Update(t) }