fix: 修正PVP模型PlayerID类型并优化空值处理
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-17 10:11:10 +08:00
committed by cnb
parent 15ecbcc7de
commit ed8e3327b4
2 changed files with 7 additions and 1 deletions

View File

@@ -26,5 +26,11 @@ func (s *PVPService) Get(userid uint32) (ret *model.PVP) {
m := s.dbm_fix(s.Model)
m.Scan(&ret)
if ret == nil {
ret = &model.PVP{
PlayerID: uint32(userid),
RankInfo: make([]model.PVPRankInfo, 0),
}
}
return
}