This commit is contained in:
aozhiwei 2024-11-13 17:04:38 +08:00
parent 774b455a19
commit ee815331fc
2 changed files with 8 additions and 0 deletions

View File

@ -82,6 +82,7 @@ CREATE TABLE `t_chip` (
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
`item_num` int(11) NOT NULL DEFAULT '0' COMMENT '道具数量',
`expiretime` int(11) NOT NULL DEFAULT '0' COMMENT '过期时间',
`calc_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后一次计算分数时间',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
KEY `idx_account_id` (`account_id`),

View File

@ -23,3 +23,10 @@ func (this *chip) List(accountId string) (error, []*model.Chip) {
"account_id = ? AND expiretime > ?", accountId, nowTime).Find(&chips)
return result.Error, chips
}
func (this *chip) CalcScore(accountId string) {
nowTime := f5.GetApp().GetRealSeconds()
chips := []*model.Chip{}
result := f5.GetApp().GetOrmDb(constant.WHEEL_DB).Table(new(model.Chip).TableName()).Where(
"account_id = ? AND expiretime > ?", accountId, nowTime).Find(&chips)
}