package model import ( "leafstalk/otherutils/deepcopy" "strconv" "xorm.io/xorm" ) type PlayerSevenDayAc struct { Id int64 PlayerId int64 `xorm:"BIGINT 'playerid'"` StartTs int64 `xorm:"BIGINT 'startts'"` TotalPoints int64 `xorm:"BIGINT 'totalpoints'"` ChallengeAwards map[int64]*ChallengeTaskStatus `xorm:"TEXT json 'challengeAwards'"` // 任务完成状态 {taskType:任务状态} 0:未完成 1:已完成未领取 2:已领取 GiftAwards map[int64]int64 `xorm:"TEXT json 'giftAwards'"` // 礼包购买状态 {uid:购买次数} PointAward int64 `xorm:"TEXT json 'pointAward'"` // 已领取积分奖励最大的uid GateId int64 `xorm:"-"` } type ChallengeTaskStatus struct { ClaimedAwards map[int64]struct{} `json:"claimedAwards"` // 已领取的uids {uid:{}} Progress int64 `json:"progress"` // 任务进度 } func (m PlayerSevenDayAc) TableName() string { return "player_sevenday_ac" } func (m *PlayerSevenDayAc) QueryExist(eng *xorm.Engine) (bool, error) { player := new(PlayerSevenDayAc) player.PlayerId = m.PlayerId return eng.Exist(player) } func (m *PlayerSevenDayAc) UpdateDB(eng *xorm.Engine) (int64, error) { return eng.Where("playerid=?", m.PlayerId).AllCols().Update(m) } func (m *PlayerSevenDayAc) GetUniqueKey() string { return strconv.FormatInt(m.PlayerId, 10) } func CopyPlayerSevenDayAc(old *PlayerSevenDayAc) *PlayerSevenDayAc { nu := deepcopy.MustCopy(old).(*PlayerSevenDayAc) return nu } // 7日任务-SevenDayMission exported from 活动-7日活动.xlsx type SevenDayMission struct { Uid int64 `json:"Uid"` // ID Days int64 `json:"Days"` // 天数 TaskType int64 `json:"TaskType"` // 任务类型 Value []int64 `json:"Value"` // 任务参数 Reward [][]int64 `json:"Reward"` // 奖励 Points int64 `json:"Points"` // 积分 Des string `json:"Des"` // 任务描述 } // package model // 7日礼包-SevenDayGiftPack exported from 活动-7日活动.xlsx type SevenDayGiftPack struct { Uid int64 `json:"Uid"` // ID Days int64 `json:"Days"` // 天数 Name string `json:"Name"` // 礼包名称 GiftPack [][]int64 `json:"GiftPack"` // 礼包 Price []int64 `json:"Price"` // 价格 CdrpId int64 `json:"CdrpId"` // 计费点 Discount float64 `json:"Discount"` // 折扣 用于前端界面显示(百分比值) Quota int64 `json:"Quota"` // 限购次数 Points int64 `json:"Points"` // 积分 } // package model // 7日积分奖励-SevenDayActive exported from 活动-7日活动.xlsx type SevenDayActive struct { Uid int64 `json:"Uid"` // ID Points int64 `json:"Points"` // 积分 Reward [][]int64 `json:"Reward"` // 奖励 }