1
This commit is contained in:
parent
774b455a19
commit
ee815331fc
@ -82,6 +82,7 @@ CREATE TABLE `t_chip` (
|
|||||||
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
|
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
|
||||||
`item_num` int(11) NOT NULL DEFAULT '0' COMMENT '道具数量',
|
`item_num` int(11) NOT NULL DEFAULT '0' COMMENT '道具数量',
|
||||||
`expiretime` 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 '创建时间',
|
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||||
KEY `idx_account_id` (`account_id`),
|
KEY `idx_account_id` (`account_id`),
|
||||||
|
@ -23,3 +23,10 @@ func (this *chip) List(accountId string) (error, []*model.Chip) {
|
|||||||
"account_id = ? AND expiretime > ?", accountId, nowTime).Find(&chips)
|
"account_id = ? AND expiretime > ?", accountId, nowTime).Find(&chips)
|
||||||
return result.Error, 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)
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user