From adf2337fde82965b4024bf95af7a07d1f733e455 Mon Sep 17 00:00:00 2001 From: yangduo Date: Fri, 6 Dec 2024 19:27:17 +0800 Subject: [PATCH] 1 --- server/wheelserver/model/user.go | 46 +++++++++++++++++--------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/server/wheelserver/model/user.go b/server/wheelserver/model/user.go index d2ff2ba3..229a5034 100644 --- a/server/wheelserver/model/user.go +++ b/server/wheelserver/model/user.go @@ -11,27 +11,27 @@ import ( ) type User struct { - Idx int64 `gorm:"column:idx;AUTO_INCREMENT"` - AccountId string `gorm:"column:account_id;primaryKey"` - Uid string `gorm:"column:uid"` - Gid string `gorm:"column:gid"` - OpenId string `gorm:"column:openid"` - Version int32 `gorm:"column:version"` - Avatar string `gorm:"column:avatar"` - NickName string `gorm:"column:nickname"` - Invited string `gorm:"column:invited"` - Ext string `gorm:"column:ext"` - Plat int32 `gorm:"column:plat"` - PlatVip int32 `gorm:"column:plat_vip"` - Score int64 `gorm:"column:score"` - Dice int32 `gorm:"column:dice"` - SpecDice int32 `gorm:"column:spec_dice"` - LastPresentDiceTime int32 `gorm:"column:last_present_dice_time"` - CurrGrid int32 `gorm:"column:curr_grid"` - AwardGrids string `gorm:"column:award_grids"` - AwardGridsList []int32 - CreateTime int32 `gorm:"column:createtime;<-:create"` - ModifyTime int32 `gorm:"column:modifytime"` + Idx int64 `gorm:"column:idx;AUTO_INCREMENT"` + AccountId string `gorm:"column:account_id;primaryKey"` + Uid string `gorm:"column:uid"` + Gid string `gorm:"column:gid"` + OpenId string `gorm:"column:openid"` + Version int32 `gorm:"column:version"` + Avatar string `gorm:"column:avatar"` + NickName string `gorm:"column:nickname"` + Invited string `gorm:"column:invited"` + Ext string `gorm:"column:ext"` + Plat int32 `gorm:"column:plat"` + PlatVip int32 `gorm:"column:plat_vip"` + Score int64 `gorm:"column:score"` + Dice int32 `gorm:"column:dice"` + SpecDice int32 `gorm:"column:spec_dice"` + LastPresentDiceTime int32 `gorm:"column:last_present_dice_time"` + CurrGrid int32 `gorm:"column:curr_grid"` + AwardGrids string `gorm:"column:award_grids"` + AwardGridsList []int32 `gorm:"-` + CreateTime int32 `gorm:"column:createtime;<-:create"` + ModifyTime int32 `gorm:"column:modifytime"` } func (this *User) TableName() string { @@ -70,7 +70,9 @@ func (this *User) Find(accountId string, nowTime int64) (error, bool) { gridstr := strings.Split(this.AwardGrids, ",") this.AwardGridsList = []int32{} for _, item := range gridstr { - this.AwardGridsList = append(this.AwardGridsList, q5.SafeToInt32(item)) + if item != "" { + this.AwardGridsList = append(this.AwardGridsList, q5.SafeToInt32(item)) + } } } return nil, result.RowsAffected > 0