You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
693 B
26 lines
693 B
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)
|
|
}
|