This commit is contained in:
aozhiwei 2024-11-06 11:52:06 +08:00
parent 4079b885e9
commit 290edb3757

View File

@ -49,6 +49,12 @@ func (this *UserApi) Login(c *gin.Context) {
if int32(q5.GetDaySeconds(nowTime, 0)) > user.LastPresentDiceTime {
user.Dice = mt.Table.Global.GetDailyDiceNum()
user.LastPresentDiceTime = q5.ToInt32(nowTime)
if result := f5.GetApp().GetOrmDb(constant.WHEEL_DB).Model(user).Select(
"dice", "last_present_dice_time").Updates(user); result.Error != nil &&
!errors.Is(result.Error, gorm.ErrRecordNotFound) {
f5.RspErr(c, 500, "server internal error")
return
}
}
rspObj.UserInfo.FromModel(user)
c.JSON(200, rspObj)