package model

import "time"
import "github.com/globalsign/mgo/bson"

// 破产金领取详情
var (
	ReliefFundLogCollName = "log_relieffund"
)

// 破产金领取详情
type ReliefFundLog struct {
	LogId    bson.ObjectId `bson:"_id"`
	SnId     int32         //玩家id
	Platform string        //平台名称

	CreateTime int64 // 注册时间
	Ts         int64 // 领取时间
	GetType    int32 // 领取方式 4:广告 5:破产补助
	CoinType   int32 //货币类型 0金币 1钻石
	GetAmount  int64 // 领取金额
}

func NewReliefFundLog() *ReliefFundLog {
	log := &ReliefFundLog{LogId: bson.NewObjectId()}
	return log
}

func NewReliefFundLogEx(snid int32, gettype, cointype int32, getamount, createtime int64, platform string) *ReliefFundLog {
	cl := NewReliefFundLog()
	cl.SnId = snid
	cl.Platform = platform

	now := time.Now()
	cl.Ts = now.Unix()
	cl.CreateTime = createtime

	cl.GetType = gettype
	cl.CoinType = cointype
	cl.GetAmount = getamount

	return cl
}
