fix(backend): 订单列表 user_name 在 real_name 为空时回退 username

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-07-10 23:27:24 +08:00
parent 7e99a7a7ee
commit 45a43c20a4
2 changed files with 27 additions and 1 deletions
+5 -1
View File
@@ -741,7 +741,11 @@ func (s *PayService) ListPurchases(shopID uint64, page, pageSize int, status str
return nil, err
}
for _, u := range users {
names[u.ID] = u.RealName
if u.RealName != "" {
names[u.ID] = u.RealName
} else {
names[u.ID] = u.Username
}
}
}