1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-02-12 22:49:29 +08:00
committed by cnb
parent aa43a2eec9
commit 008aa97675
2 changed files with 13 additions and 1 deletions

View File

@@ -153,7 +153,11 @@ func (h Controller) ChangePlayerCloth(data *item.ChangePlayerClothInboundInfo, p
}
for _, clothID := range data.ClothList {
result.ClothList = append(result.ClothList, model.PeopleItemInfo{ID: clothID, Level: 1})
if player.Service.Item.Exist(clothID) {
result.ClothList = append(result.ClothList, model.PeopleItemInfo{ID: clothID, Level: 1})
}
}
player.Info.Clothes = result.ClothList

View File

@@ -8,6 +8,14 @@ import (
"github.com/gogf/gf/v2/frame/g"
)
func (s *ItemService) Exist(itemid uint32) bool {
var ttt *model.Item
s.TestModel(s.Model).Where("item_id", itemid).Scan(&ttt)
return ttt != nil
}
func (s *ItemService) Get(min, max uint32) []model.Item {
var ttt []model.Item