diff --git a/logic/service/player/player.go b/logic/service/player/player.go index c4dcca3a7..7f2b7e15d 100644 --- a/logic/service/player/player.go +++ b/logic/service/player/player.go @@ -294,6 +294,10 @@ func (p *Player) Cheak(b error) { } func (p *Player) GiveTitle(id uint32) { + r := p.Service.Title.Can(id) //已经有了就不给了 + if !r { + return + } p.Service.Title.Give(id) p.SendPackCmd(50005, &info.S2C_50005{ Title: id, diff --git a/modules/config/controller/admin/boss.go b/modules/config/controller/admin/boss.go index ecfdea6a3..1b36d7973 100644 --- a/modules/config/controller/admin/boss.go +++ b/modules/config/controller/admin/boss.go @@ -3,6 +3,9 @@ package admin import ( "blazing/cool" "blazing/modules/config/service" + "context" + + "github.com/gogf/gf/v2/frame/g" ) type BossController struct { @@ -20,3 +23,14 @@ func init() { // 注册路由 cool.RegisterController(task_info_controller) } + +type GetListReq struct { + g.Meta `path:"/getlist" method:"POST"` + Id uint32 `json:"id" v:"required#请选择要查询的数据"` +} + +func (this *BossController) GetList(ctx context.Context, req *GetListReq) (res *cool.BaseRes, err error) { + res = &cool.BaseRes{} + res.Data = service.NewBossService().GetList(req.Id) + return res, nil +} diff --git a/modules/config/model/base_pet.go b/modules/config/model/base_pet.go index 2cd21f140..e6a1760a9 100644 --- a/modules/config/model/base_pet.go +++ b/modules/config/model/base_pet.go @@ -37,7 +37,7 @@ type PetBaseConfig struct { SKill []uint32 `gorm:"type:jsonb;not null;default:'[]';comment:'BOSS技能'" json:"skill"` - Desc *string `gorm:"comment:'BOSS描述'" json:"desc"` + Remark string `gorm:"comment:'BOSS备注'" json:"remark"` // ISMELEE uint32 `gorm:"not null;default:0;comment:'是否乱斗配置'" json:"is_melee"` // // ===================== BOSS奖励规则(Boss_bonus) ===================== diff --git a/modules/config/model/shop.go b/modules/config/model/shop.go index a98d10076..ff306735e 100644 --- a/modules/config/model/shop.go +++ b/modules/config/model/shop.go @@ -27,7 +27,7 @@ type ShopConfig struct { Stock uint32 `gorm:"not null;default:0;comment:'商品库存数量(0表示无限库存)'" json:"stock" description:"库存数量"` // 限购信息 - QuotaLimit uint32 `gorm:"not null;default:0;comment:'单位时间内的限购数量(0表示不限购)'" json:"quota_limit" description:"限购数量"` + QuotaLimit uint32 `gorm:"not null;default:0;comment:'单位时间内的限购数量'" json:"quota_limit" description:"限购数量"` //限购类型 QuotaType uint32 `gorm:"not null;default:0;comment:'限购类型(0-不限购 1-每日限购 2-每周限购 3-每月限购)'" json:"quota_type" description:"限购类型"` } diff --git a/modules/config/model/tower_110.go b/modules/config/model/tower_110.go index a49bbe56c..504e5d8bb 100644 --- a/modules/config/model/tower_110.go +++ b/modules/config/model/tower_110.go @@ -19,7 +19,6 @@ type BaseTowerConfig struct { // 核心必填字段(所有塔类型通用) TowerLevel uint32 `gorm:"not null;default:0;uniqueIndex;comment:'塔层数(唯一标识每层配置)'" json:"tower_level" description:"塔层数"` BossIds []uint32 `gorm:"not null;type:json;default:'[]';comment:'绑定BOSS ID数组,关联config_pet_boss表主键'" json:"boss_ids" description:"绑定BOSS数组"` - TaskIds []uint32 `gorm:"not null;type:json;default:'[]';comment:'绑定任务ID数组,关联config_task表主键'" json:"task_ids" description:"绑定任务数组"` } // NewBaseTowerConfig 创建基础塔配置实例(所有塔类型共用) diff --git a/modules/config/service/boss.go b/modules/config/service/boss.go index bfeae8ce2..7890a38e9 100644 --- a/modules/config/service/boss.go +++ b/modules/config/service/boss.go @@ -30,3 +30,13 @@ func (s *BossService) Get(id uint32) *model.BossConfig { return item } +func (s *BossService) GetList(id uint32) []model.BossConfig { + + var ret []model.BossConfig + + // 执行 Raw SQL 并扫描返回值 + dbm_nocache_noenable(s.Model). + Wheref(`map_id @> ARRAY[?]::integer[]`, id).WhereOrf(`map_id @> ARRAY[?]::integer[]`, 0).Scan(&ret) + + return ret +}