Merge remote-tracking branch 'origin/feat/1.0.2/user' into test

This commit is contained in:
LinkinStar 2023-01-04 10:10:10 +08:00
commit 5a2fea3637
2 changed files with 20 additions and 14 deletions

View File

@ -135,21 +135,21 @@ backend:
other: "Username is already in use."
set_avatar:
other: "Avatar set failed."
config:
read_config_failed:
other: "Read config failed"
database:
connection_failed:
other: "Database connection failed"
create_table_failed:
other: "Create table failed"
install:
create_config_failed:
other: "Cant create the config.yaml file."
cannot_update_your_role:
other: "You cannot modify your role."
not_allowed_registration:
other: "Currently the site is not open for registration"
config:
read_config_failed:
other: "Read config failed"
database:
connection_failed:
other: "Database connection failed"
create_table_failed:
other: "Create table failed"
install:
create_config_failed:
other: "Cant create the config.yaml file."
report:
spam:
name:

View File

@ -190,9 +190,15 @@ func (qs *QuestionCommon) Info(ctx context.Context, questionID string, loginUser
showinfo.Tags = tagmap
userIds := make([]string, 0)
userIds = append(userIds, dbinfo.UserID)
userIds = append(userIds, dbinfo.LastEditUserID)
userIds = append(userIds, showinfo.LastAnsweredUserID)
if checker.IsNotZeroString(dbinfo.UserID) {
userIds = append(userIds, dbinfo.UserID)
}
if checker.IsNotZeroString(dbinfo.LastEditUserID) {
userIds = append(userIds, dbinfo.LastEditUserID)
}
if checker.IsNotZeroString(showinfo.LastAnsweredUserID) {
userIds = append(userIds, showinfo.LastAnsweredUserID)
}
userInfoMap, err := qs.userCommon.BatchUserBasicInfoByID(ctx, userIds)
if err != nil {
return showinfo, err