This commit is contained in:
aozhiwei 2024-11-06 11:34:00 +08:00
parent 8f68be90d6
commit 93c252b0d8
3 changed files with 3 additions and 0 deletions

View File

@ -61,6 +61,7 @@ CREATE TABLE `t_user` (
`nickname` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT 'nickname',
`score` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT 'score',
`dice` int(11) NOT NULL DEFAULT '0' COMMENT '骰子数',
`last_present_dice_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后赠送骰子时间',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
UNIQUE KEY `uk_account_id` (`account_id`),

View File

@ -38,6 +38,7 @@ func (this *UserApi) Login(c *gin.Context) {
user.NickName = s.GetNickName()
user.Score = ""
user.Dice = mt.Table.Global.GetDailyDiceNum()
user.LastPresentDiceTime = q5.ToInt32(nowTime)
user.CreateTime = q5.ToInt32(nowTime)
user.ModifyTime = q5.ToInt32(nowTime)
if result := f5.GetApp().GetOrmDb(constant.WHEEL_DB).Create(user); result.Error != nil {

View File

@ -7,6 +7,7 @@ type User struct {
NickName string `gorm:"column:nickname"`
Score string `gorm:"column:score"`
Dice int32 `gorm:"column:dice"`
LastPresentDiceTime int32 `gorm:"column:last_present_dice_time"`
CreateTime int32 `gorm:"column:createtime"`
ModifyTime int32 `gorm:"column:modifytime"`
}