feat(api): add referral percentage and only first purchase fields to user model and requests
This commit is contained in:
@@ -41,20 +41,20 @@ func (l *GetUserListLogic) GetUserList(req *types.GetUserListRequest) (*types.Ge
|
||||
userRespList := make([]types.User, 0, len(list))
|
||||
|
||||
for _, item := range list {
|
||||
var user types.User
|
||||
tool.DeepCopy(&user, item)
|
||||
var u types.User
|
||||
tool.DeepCopy(&u, item)
|
||||
|
||||
// 处理 AuthMethods
|
||||
authMethods := make([]types.UserAuthMethod, len(user.AuthMethods)) // 直接创建目标 slice
|
||||
for i, method := range user.AuthMethods {
|
||||
authMethods := make([]types.UserAuthMethod, len(u.AuthMethods)) // 直接创建目标 slice
|
||||
for i, method := range u.AuthMethods {
|
||||
tool.DeepCopy(&authMethods[i], method)
|
||||
if method.AuthType == "mobile" {
|
||||
authMethods[i].AuthIdentifier = phone.FormatToInternational(method.AuthIdentifier)
|
||||
}
|
||||
}
|
||||
user.AuthMethods = authMethods
|
||||
u.AuthMethods = authMethods
|
||||
|
||||
userRespList = append(userRespList, user)
|
||||
userRespList = append(userRespList, u)
|
||||
}
|
||||
|
||||
return &types.GetUserListResponse{
|
||||
|
||||
Reference in New Issue
Block a user