From ee815331fc32648c9eeb2c44f79efe33b8c4ff14 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 13 Nov 2024 17:04:38 +0800 Subject: [PATCH] 1 --- database/wheeldb.sql | 1 + server/wheelserver/service/chip.go | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/database/wheeldb.sql b/database/wheeldb.sql index 76c8485c..7edad2a3 100644 --- a/database/wheeldb.sql +++ b/database/wheeldb.sql @@ -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`), diff --git a/server/wheelserver/service/chip.go b/server/wheelserver/service/chip.go index 9f692940..c26a872f 100644 --- a/server/wheelserver/service/chip.go +++ b/server/wheelserver/service/chip.go @@ -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) +}