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

This commit is contained in:
昔念
2026-04-15 22:42:56 +08:00
parent ee8b0a2182
commit 9f7fd83626
3 changed files with 11 additions and 15 deletions

View File

@@ -76,8 +76,12 @@ func (s *PetService) PetCount(flag int) int {
return ret
}
func (s *PetService) UpdateFree(catchTime, free uint32) bool {
res, err := s.dbm(s.Model).Where("catch_time", catchTime).Data("free", free).Update()
func (s *PetService) UpdateFree(catchTime, fromFree, toFree uint32) bool {
res, err := s.dbm(s.Model).
Where("catch_time", catchTime).
Where("free", fromFree).
Data("free", toFree).
Update()
if err != nil {
return false
}