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.
25 lines
658 B
25 lines
658 B
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)
|
|
}
|