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