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
828 B
26 lines
828 B
package models
|
|
|
|
import (
|
|
"github.com/ouxuanserver/osmanthuswine/src/core"
|
|
"time"
|
|
)
|
|
|
|
const RewardWalletTableName = TableNamePrefix + "reward_wallet"
|
|
|
|
//打赏钱包
|
|
type RewardWallet struct {
|
|
Id int64 `json:"id"`
|
|
CustomerId int64 `json:"customer_id" description:"客户id"`
|
|
Balance float64 `json:"balance" description:"余额"`
|
|
IsDelete bool `json:"is_delete" xorm:"default(0)"`
|
|
CreatedAt time.Time `json:"created_at" xorm:"created" description:"创建时间"`
|
|
UpdatedAt time.Time `json:"updated_at" xorm:"updated" description:"更新时间"`
|
|
}
|
|
|
|
func (t *RewardWallet) TableName() string {
|
|
return RewardWalletTableName
|
|
}
|
|
|
|
func (t *RewardWallet) IncrBalance(cid int64, money float64) (int64, error) {
|
|
return core.GetXormAuto().Where("customer_id=?", cid).Incr("balance", money).Update(t)
|
|
}
|