45 lines
1.0 KiB
Go
45 lines
1.0 KiB
Go
package model
|
|
|
|
import "time"
|
|
import "github.com/globalsign/mgo/bson"
|
|
|
|
// 破产次数统计
|
|
type BankruptLog struct {
|
|
LogId bson.ObjectId `bson:"_id"`
|
|
SnId int32 //玩家id
|
|
Channel string // 渠道
|
|
ChannelId string // 推广渠道
|
|
Platform string //平台名称
|
|
GameId int //游戏id
|
|
GameFreeID int32 //房间id
|
|
GameDif string // 游戏分组
|
|
|
|
CreateTime int64 // 注册时间
|
|
UseCoin int64 // 消耗金币
|
|
Ts int64 // 破产时间
|
|
}
|
|
|
|
func NewBankruptLog() *BankruptLog {
|
|
log := &BankruptLog{LogId: bson.NewObjectId()}
|
|
return log
|
|
}
|
|
|
|
func NewBankruptLogEx(snid int32, gamefreeid int32, createtime, usecoin int64, platform, channel, channelId, gamedif string, gameId int) *BankruptLog {
|
|
cl := NewBankruptLog()
|
|
cl.SnId = snid
|
|
cl.Platform = platform
|
|
cl.Channel = channel
|
|
cl.ChannelId = channelId
|
|
cl.GameId = gameId
|
|
cl.GameDif = gamedif
|
|
|
|
cl.GameFreeID = gamefreeid
|
|
cl.CreateTime = createtime
|
|
|
|
now := time.Now()
|
|
cl.Ts = now.Unix()
|
|
cl.UseCoin = usecoin
|
|
|
|
return cl
|
|
}
|