fix: 修正PVP模型PlayerID类型并优化空值处理
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user