|
|
|
@@ -2,6 +2,7 @@ package user |
|
|
|
|
|
|
|
import ( |
|
|
|
"errors" |
|
|
|
"strconv" |
|
|
|
"strings" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/models" |
|
|
|
@@ -43,6 +44,12 @@ func GetInvitaionCode(ctx *context.Context) { |
|
|
|
if ctx.IsSigned { |
|
|
|
resultJsonMap["invitation_code"] = getInvitaionCode(ctx) |
|
|
|
re, count := models.QueryInvitaionBySrcUserId(ctx.User.ID, (page-1)*pageSize, pageSize) |
|
|
|
for _, record := range re { |
|
|
|
tmpUser, err := models.GetUserByID(record.UserID) |
|
|
|
if err == nil { |
|
|
|
record.Avatar = strings.TrimRight(setting.AppSubURL, "/") + "/user/avatar/" + tmpUser.Name + "/" + strconv.Itoa(-1) |
|
|
|
} |
|
|
|
} |
|
|
|
resultJsonMap["invitation_users"] = re |
|
|
|
resultJsonMap["invitation_users_count"] = count |
|
|
|
} |
|
|
|
|