feat: 添加批量检查物品数量的方法并优化宠物融合逻辑
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

在物品服务中添加CheakItemM方法用于批量检查物品数量
修改宠物融合逻辑使用新方法进行物品检查
This commit is contained in:
xinian
2026-02-26 10:24:30 +08:00
committed by cnb
parent 6c61059cfe
commit 0485fbca43
2 changed files with 12 additions and 3 deletions

View File

@@ -67,6 +67,13 @@ func (s *ItemService) CheakItem(id uint32) int64 {
m.Where("item_id", id).Scan(&ttt)
return ttt.ItemCnt
}
func (s *ItemService) CheakItemM(id ...uint32) []model.Item {
var ttt []model.Item
m := s.dbm(s.Model)
m.WhereIn("item_id", id).Scan(&ttt)
return ttt
}
// /添加进来的物品一定是保证存在的
type ItemService struct {