@@ -13,6 +13,7 @@ type Invitation struct { | |||
SrcUserID int64 `xorm:"NOT NULL DEFAULT 0"` | |||
UserID int64 `xorm:"NOT NULL DEFAULT 0"` | |||
Phone string `xorm:"INDEX"` | |||
Email string `xorm:"-"` | |||
Avatar string `xorm:"-"` | |||
Name string `xorm:"-"` | |||
InvitationUserNum int `xorm:"-"` | |||
@@ -49,9 +49,10 @@ func getInvitationDetailExcelHeader(ctx *context.Context) map[string]string { | |||
excelHeader := make([]string, 0) | |||
excelHeader = append(excelHeader, ctx.Tr("user.static.id")) | |||
excelHeader = append(excelHeader, ctx.Tr("user.static.name")) | |||
excelHeader = append(excelHeader, ctx.Tr("user.static.srcUserId")) | |||
excelHeader = append(excelHeader, ctx.Tr("user.static.email")) | |||
excelHeader = append(excelHeader, ctx.Tr("user.static.phone")) | |||
excelHeader = append(excelHeader, ctx.Tr("user.static.registdate")) | |||
excelHeader = append(excelHeader, ctx.Tr("user.static.srcUserId")) | |||
excelHeaderMap := make(map[string]string, 0) | |||
var i byte | |||
@@ -92,8 +93,7 @@ func writeInvitationDetailExcel(row int, xlsx *excelize.File, sheetName string, | |||
tmp = tmp + 1 | |||
xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userRecord.Name) | |||
tmp = tmp + 1 | |||
xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userRecord.SrcUserID) | |||
xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userRecord.Email) | |||
tmp = tmp + 1 | |||
xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userRecord.Phone) | |||
@@ -101,7 +101,9 @@ func writeInvitationDetailExcel(row int, xlsx *excelize.File, sheetName string, | |||
formatTime := userRecord.CreatedUnix.Format("2006-01-02 15:04:05") | |||
xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, formatTime[0:len(formatTime)-3]) | |||
tmp = tmp + 1 | |||
xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userRecord.SrcUserID) | |||
} | |||
func DownloadInvitationDetail(ctx *context.Context) { | |||
@@ -413,6 +415,7 @@ func queryData(ctx *context.Context, startTime time.Time, endTime time.Time) { | |||
invi.Name = tmpUser.Name | |||
invi.Phone = tmpUser.PhoneNumber | |||
invi.CreatedUnix = tmpUser.CreatedUnix | |||
invi.Email = tmpUser.Email | |||
} else { | |||
invi.Name = "已注销" | |||
} | |||
@@ -63,7 +63,7 @@ func InviationTpl(ctx *context.Context) { | |||
ctx.HTML(200, tplInvitation) | |||
} | |||
func RegisteUserByInvitaionCode(invitationcode string, newUserId int64, newPhoneNumber string) error { | |||
func RegisteUserByInvitaionCode(invitationcode string, newUserId int64, newPhoneNumber string, email string) error { | |||
user := parseInvitaionCode(invitationcode) | |||
if user == nil { | |||
return errors.New("The invitated user not existed.") | |||
@@ -85,6 +85,7 @@ func RegisteUserByInvitaionCode(invitationcode string, newUserId int64, newPhone | |||
SrcUserID: user.ID, | |||
UserID: newUserId, | |||
Phone: newPhoneNumber, | |||
Email: email, | |||
} | |||
err := models.InsertInvitaion(invitation) | |||
@@ -1368,7 +1368,7 @@ func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterFo | |||
log.Info("enter here, and form.InvitaionCode =" + invitationCode) | |||
if invitationCode != "" { | |||
RegisteUserByInvitaionCode(invitationCode, u.ID, u.PhoneNumber) | |||
RegisteUserByInvitaionCode(invitationCode, u.ID, u.PhoneNumber, u.Email) | |||
} | |||
err := models.AddEmailAddress(&models.EmailAddress{ | |||
@@ -32,18 +32,7 @@ | |||
> | |||
</template> | |||
</el-table-column> | |||
<el-table-column | |||
prop="status" | |||
:label="i18n.model_status" | |||
align="center" | |||
min-width="6.5%" | |||
> | |||
<template slot-scope="scope"> | |||
<span class="text-over" :title="scope.row.status_title"> | |||
<i style="vertical-align: middle" :class="scope.row.status"></i | |||
></span> | |||
</template> | |||
</el-table-column> | |||
<el-table-column | |||
prop="version" | |||
:label="i18n.model_version" | |||
@@ -103,11 +92,14 @@ | |||
</el-table-column> | |||
<el-table-column | |||
prop="isPrivate" | |||
:label="i18n.model_access" | |||
:label="i18n.model_status" | |||
align="center" | |||
min-width="6.75%" | |||
> | |||
<template slot-scope="scope"> | |||
<span class="text-over" :title="scope.row.status_title"> | |||
<i style="vertical-align: middle" :class="scope.row.status"></i | |||
></span> | |||
<span class="text-over" :title="scope.row.isPrivate"> | |||
{{transStatus(scope.row.isPrivate)}} | |||
</span> | |||
@@ -157,8 +149,8 @@ | |||
:class="{ disabled: !scope.row.isCanOper }" | |||
>{{ i18n.modify }}</a> | |||
<a class="op-btn" v-show="scope.row.modelType != 1" style="color:transparent;cursor:default;" >{{ i18n.modify }}</a> | |||
<a class="op-btn" v-show="repoIsPrivate == false && scope.row.isPrivate==true && scope.row.isCanOper">>{{ i18n.modelaccess_setpublic }}</a> | |||
<a class="op-btn" v-show="repoIsPrivate == false && scope.row.isPrivate==false && scope.row.isCanOper">>{{ i18n.modelaccess_setprivate }}</a> | |||
<a class="op-btn" v-show="repoIsPrivate == false && scope.row.isPrivate==true && scope.row.isCanOper">{{ i18n.modelaccess_setpublic }}</a> | |||
<a class="op-btn" v-show="repoIsPrivate == false && scope.row.isPrivate==false && scope.row.isCanOper">{{ i18n.modelaccess_setprivate }}</a> | |||
<a class="op-btn" | |||
:href="loadhref + scope.row.id" | |||