diff --git a/logic/controller/item_use.go b/logic/controller/item_use.go index 91b9571c..efc4cfab 100644 --- a/logic/controller/item_use.go +++ b/logic/controller/item_use.go @@ -153,6 +153,11 @@ func (h Controller) UseSpeedupItem(data *item.C2S_USE_SPEEDUP_ITEM, c *player.Pl return nil, errorcode.ErrorCodes.ErrItemInUse } c.Info.ThreeTimes += 50 // 玩家对象新增 ThreeTimesExp 字段存储三倍剩余次数 + case 300115: + if c.Info.ThreeTimes != 0 { + return nil, errorcode.ErrorCodes.ErrItemInUse + } + c.Info.ThreeTimes += 30 // 玩家对象新增 ThreeTimesExp 字段存储三倍剩余次数 default: return nil, errorcode.ErrorCodes.ErrSystemError // 未知道具ID } diff --git a/modules/config/model/config_egg.go b/modules/config/model/config_egg.go index 1d63e0d2..0117a614 100644 --- a/modules/config/model/config_egg.go +++ b/modules/config/model/config_egg.go @@ -2,6 +2,8 @@ package model import ( "blazing/cool" + + "github.com/gogf/gf/v2/os/gtime" ) const ( @@ -9,9 +11,12 @@ const ( ) type BaseConfig struct { - *cool.Model // 保留通用Model(ID/创建时间/更新时间等) - IsEnable int32 `gorm:"not null;default:0;comment:'是否启用(1:启用,0:禁用)'" json:"is_enable"` // 保留原有逻辑 - Remark string `gorm:"type:varchar(255);default:'';comment:'性别配置备注(如:默认性别规则)'" json:"remark"` // 调整注释 + ID uint `gorm:"primaryKey" json:"id"` + CreateTime *gtime.Time ` gorm:"column:createTime;not null;index,priority:1;autoCreateTime:nano;comment:创建时间" json:"createTime"` // 创建时间 + UpdateTime *gtime.Time `orm:"autoUpdateTime=true" gorm:"column:updateTime;not null;index,priority:1;autoUpdateTime:nano;comment:更新时间" json:"updateTime"` // 更新时间 + DeletedAt *gtime.Time `gorm:"index" json:"deletedAt"` + IsEnable int32 `gorm:"not null;default:0;comment:'是否启用(1:启用,0:禁用)'" json:"is_enable"` // 保留原有逻辑 + Remark string `gorm:"type:varchar(255);default:'';comment:'性别配置备注(如:默认性别规则)'" json:"remark"` // 调整注释 } func (m *BaseConfig) TableName() string { @@ -24,9 +29,7 @@ func (m *BaseConfig) GroupName() string { } func NewBaseConfig() *BaseConfig { - return &BaseConfig{ - Model: cool.NewModel(), - } + return &BaseConfig{} } // Egg 性别配置模型(替换原宠物融合配方模型) diff --git a/modules/player/controller/admin/title.go b/modules/player/controller/admin/title.go index f7da2093..df7a1da8 100644 --- a/modules/player/controller/admin/title.go +++ b/modules/player/controller/admin/title.go @@ -42,12 +42,13 @@ func (c *TitleController) Get(ctx context.Context, req *GetReq) (res *cool.BaseR for _, v := range alltitile { tt := TitleRes{ - ID: v, - Name: titles[v].Name, + ID: v, } - if titles[v].Remark != nil { - tt.Desc = *titles[v].Remark + info := titles[v] + if info.Remark != nil { + tt.Desc = *info.Remark } + tt.Name = info.Name ret = append(ret, tt) }