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

This commit is contained in:
昔念
2026-04-22 01:21:07 +08:00
parent a6386daad8
commit eb76c22c41
2 changed files with 55 additions and 0 deletions

View File

@@ -101,6 +101,27 @@ func (s *PetService) UpdateIsShow(catchTime uint32, isShow int) bool {
return r > 0
}
// SetShowCatchTimes 批量设置基地展示精灵:
// 先清空当前玩家的展示状态,再将传入 catchTime 列表置为展示。
func (s *PetService) SetShowCatchTimes(catchTimes []uint32) bool {
if _, err := s.dbm(s.Model).
Where("is_show", 1).
Data("is_show", 0).
Update(); err != nil {
return false
}
if len(catchTimes) == 0 {
return true
}
if _, err := s.dbm(s.Model).
WhereIn("catch_time", catchTimes).
Data("is_show", 1).
Update(); err != nil {
return false
}
return true
}
func (s *PetService) UpdateFree(catchTime, fromFree, toFree uint32) bool {
res, err := s.dbm(s.Model).
Where("catch_time", catchTime).