fix: 更新宠物状态时处理错误返回

This commit is contained in:
xinian
2026-03-25 00:47:53 +08:00
committed by cnb
parent 21830ddf6a
commit e0a82d57b4

View File

@@ -43,10 +43,13 @@ func (s *PetService) PetCount(flag int) int {
func (s *PetService) UPdateFree(ctime uint32, free uint32) bool {
res, _ := s.dbm(s.Model).Where("catch_time", ctime).Data(
res, err := s.dbm(s.Model).Where("catch_time", ctime).Data(
"free", free,
).Update()
if err != nil {
return false
}
r, _ := res.RowsAffected()
return r > 0
}