refactor: 优化地图节点数据获取逻辑
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

将获取地图Boss信息的过滤逻辑从循环中移至GetDataB方法
This commit is contained in:
xinian
2026-02-27 11:06:03 +08:00
committed by cnb
parent bc2f222036
commit ad43fc8173
2 changed files with 19 additions and 13 deletions

View File

@@ -27,6 +27,14 @@ func (s *MapNodeService) GetData(mapid uint32) []model.MapNode {
return pet
}
func (s *MapNodeService) GetDataB(mapid uint32) []model.MapNode {
var pet []model.MapNode //一个特性应该是唯一的,但是我们要获取默认随机特性
dbm_enable(s.Model).Where("map_id", mapid).Where("is_broadcast", 1).Scan(&pet)
return pet
}
func (s *MapNodeService) GetDataNode(mapid, node uint32) *model.MapNode {