package model type CreditRecord struct { Id int64 `json:"-"` // 唯一标识符,主键,自增 PlayerId int64 `xorm:"BIGINT index 'playerid'" json:"-"` ChangeValue int64 `xorm:"INT 'changevalue'" json:"change"` // 变化值 NewScore int64 `xorm:"INT 'newscore'" json:"newScore"` // 变化后信誉积分 Reason int `xorm:"INT 'reason'" json:"reason"` CreatedTime int64 `xorm:"created" json:"createdTime"` // 变化时间 } type PlayerCreditRecords struct { PlayerId int64 `json:"playerId"` // 玩家ID CreditRecords []*CreditRecord `json:"creditRecords"` // 10条信用记录 LastLoadTs2 int64 // LastCreatedTs int64 //最后一条记录的穿件时间,只能加载协程使用 // NewLoads []*CreditRecord // 辅助加载函数;业务功能不要使用 } func (p *PlayerCreditRecords) IsDirty() bool { return (p.LastLoadTs2 == -1) }