package models import ( cutils "github.com/mhaya/extend/utils" "github.com/mhaya/game/game_cluster/internal/constant" ) type CashOutRecord struct { UserName string `json:"userName" bson:"userName"` // 用户名字 NickName string `json:"nickName" bson:"nickName"` // 昵称 Status int `json:"status" bson:"status"` // 0:未审核 1:审核通过 2:审核失败 Amount int `json:"amount" bson:"amount"` // AfterAmount int `json:"afterAmount" bson:"after_amount"` // Type int `json:"type" bson:"type"` // 货币内型 Address string `json:"address" bson:"address"` // 地址 State int `json:"state" bson:"state"` //服务器是否已经处理 0 未处理 1已处理 Withdrawal int `json:"withdrawal" bson:"withdrawal"` // 提现 0 :未体现 1:提现成功 2:提现中 3:提现失败 4:拒绝提现 CreateAt int64 `json:"createAt" bson:"createAt"` UpdateAt int64 `json:"updateAt" bson:"updateAt"` } type UserWithdrawal struct { Id string `json:"id" bson:"_id"` // Id UserName string `json:"user_name" bson:"userName"` // 用户ID NickName string `json:"nick_name" bson:"nickName"` // 昵称 Status int `json:"status" bson:"status"` // 0:未审核 1:审核通过 2:审核失败 Reason string `json:"reason" bson:"reason"` // 提现原因 Withdrawal int `json:"withdrawal" bson:"withdrawal"` // 提现 1:提现成功 2:提现中 3:提现失败 4:拒绝提现 State int `json:"-" bson:"state"` //服务器是否已经处理 0 未处理 1已处理 Amount int `json:"amount" bson:"amount"` // 提现金额 AfterAmount int `json:"after_amount" bson:"after_amount"` // 提现后金额 Type int `json:"type" bson:"type"` // 货币内型 Address string `json:"address" bson:"address"` // 地址 CreateAt int64 `json:"createAt" bson:"createAt"` // 提现时间 UpdateAt int64 `json:"updateAt" bson:"updateAt"` } type ToUserWithdrawal struct { Id string `json:"id" bson:"_id"` // Id UserName string `json:"user_name" bson:"userName"` // 用户ID NickName string `json:"nick_name" bson:"nickName"` // 昵称 Status int `json:"status" bson:"status"` // 0:未审核 1:审核通过 2:审核失败 Reason string `json:"reason" bson:"reason"` // 提现原因 Withdrawal int `json:"withdrawal" bson:"withdrawal"` // 提现 1:提现成功 2:提现中 3:提现失败 4:拒绝提现 Amount float64 `json:"amount" bson:"amount"` // 提现金额 State int `json:"-" bson:"state"` //服务器是否已经处理 0 未处理 1已处理 AfterAmount float64 `json:"after_amount" bson:"after_amount"` // 提现后金额 Type int `json:"type" bson:"type"` // 货币内型 Address string `json:"address" bson:"address"` // 地址 CreateAt int64 `json:"createAt" bson:"createAt"` // 提现时间 UpdateAt int64 `json:"updateAt" bson:"updateAt"` } func (uw *UserWithdrawal) To() *ToUserWithdrawal { var ret = &ToUserWithdrawal{ Id: uw.Id, UserName: uw.UserName, NickName: uw.NickName, Status: uw.Status, Reason: uw.Reason, Withdrawal: uw.Withdrawal, Amount: cutils.QuoInt64ByRatioToFloat64(int64(uw.Amount), constant.MoneyRatio), AfterAmount: cutils.QuoInt64ByRatioToFloat64(int64(uw.AfterAmount), constant.MoneyRatio), Type: uw.Type, Address: uw.Address, CreateAt: uw.CreateAt, UpdateAt: uw.UpdateAt, } return ret }