diff options
Diffstat (limited to 'models')
-rw-r--r-- | models/issue.go | 2 | ||||
-rw-r--r-- | models/issue_list.go | 2 | ||||
-rw-r--r-- | models/issue_watch.go | 2 | ||||
-rw-r--r-- | models/org.go | 4 | ||||
-rw-r--r-- | models/repo.go | 2 | ||||
-rw-r--r-- | models/repo_watch.go | 2 | ||||
-rw-r--r-- | models/user.go | 8 |
7 files changed, 11 insertions, 11 deletions
diff --git a/models/issue.go b/models/issue.go index c89ffa7d0f..1ac200c800 100644 --- a/models/issue.go +++ b/models/issue.go @@ -1297,7 +1297,7 @@ func getParticipantsByIssueID(e Engine, issueID int64) ([]*User, error) { And("`comment`.type = ?", CommentTypeComment). And("`user`.is_active = ?", true). And("`user`.prohibit_login = ?", false). - Join("INNER", "user", "`user`.id = `comment`.poster_id"). + Join("INNER", "`user`", "`user`.id = `comment`.poster_id"). Distinct("poster_id"). Find(&userIDs); err != nil { return nil, fmt.Errorf("get poster IDs: %v", err) diff --git a/models/issue_list.go b/models/issue_list.go index 05130a6eef..fdfca71aff 100644 --- a/models/issue_list.go +++ b/models/issue_list.go @@ -166,7 +166,7 @@ func (issues IssueList) loadAssignees(e Engine) error { var assignees = make(map[int64][]*User, len(issues)) rows, err := e.Table("issue_assignees"). - Join("INNER", "user", "`user`.id = `issue_assignees`.assignee_id"). + Join("INNER", "`user`", "`user`.id = `issue_assignees`.assignee_id"). In("`issue_assignees`.issue_id", issues.getIssueIDs()). Rows(new(AssigneeIssue)) if err != nil { diff --git a/models/issue_watch.go b/models/issue_watch.go index 3e7d24821b..579c915476 100644 --- a/models/issue_watch.go +++ b/models/issue_watch.go @@ -67,7 +67,7 @@ func getIssueWatchers(e Engine, issueID int64) (watches []*IssueWatch, err error Where("`issue_watch`.issue_id = ?", issueID). And("`user`.is_active = ?", true). And("`user`.prohibit_login = ?", false). - Join("INNER", "user", "`user`.id = `issue_watch`.user_id"). + Join("INNER", "`user`", "`user`.id = `issue_watch`.user_id"). Find(&watches) return } diff --git a/models/org.go b/models/org.go index 23f6c58bf6..bd5fc825b8 100644 --- a/models/org.go +++ b/models/org.go @@ -383,7 +383,7 @@ func GetOwnedOrgsByUserIDDesc(userID int64, desc string) ([]*User, error) { func GetOrgUsersByUserID(uid int64, all bool) ([]*OrgUser, error) { ous := make([]*OrgUser, 0, 10) sess := x. - Join("LEFT", "user", "`org_user`.org_id=`user`.id"). + Join("LEFT", "`user`", "`org_user`.org_id=`user`.id"). Where("`org_user`.uid=?", uid) if !all { // Only show public organizations @@ -575,7 +575,7 @@ func (org *User) getUserTeams(e Engine, userID int64, cols ...string) ([]*Team, return teams, e. Where("`team_user`.org_id = ?", org.ID). Join("INNER", "team_user", "`team_user`.team_id = team.id"). - Join("INNER", "user", "`user`.id=team_user.uid"). + Join("INNER", "`user`", "`user`.id=team_user.uid"). And("`team_user`.uid = ?", userID). Asc("`user`.name"). Cols(cols...). diff --git a/models/repo.go b/models/repo.go index e87883969d..3c4908b0d8 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1958,7 +1958,7 @@ func DeleteRepository(doer *User, uid, repoID int64) error { func GetRepositoryByOwnerAndName(ownerName, repoName string) (*Repository, error) { var repo Repository has, err := x.Select("repository.*"). - Join("INNER", "user", "`user`.id = repository.owner_id"). + Join("INNER", "`user`", "`user`.id = repository.owner_id"). Where("repository.lower_name = ?", strings.ToLower(repoName)). And("`user`.lower_name = ?", strings.ToLower(ownerName)). Get(&repo) diff --git a/models/repo_watch.go b/models/repo_watch.go index 8019027c1e..95c7e44e93 100644 --- a/models/repo_watch.go +++ b/models/repo_watch.go @@ -54,7 +54,7 @@ func getWatchers(e Engine, repoID int64) ([]*Watch, error) { return watches, e.Where("`watch`.repo_id=?", repoID). And("`user`.is_active=?", true). And("`user`.prohibit_login=?", false). - Join("INNER", "user", "`user`.id = `watch`.user_id"). + Join("INNER", "`user`", "`user`.id = `watch`.user_id"). Find(&watches) } diff --git a/models/user.go b/models/user.go index 0b7af8df6d..32b9bfec9b 100644 --- a/models/user.go +++ b/models/user.go @@ -374,9 +374,9 @@ func (u *User) GetFollowers(page int) ([]*User, error) { Limit(ItemsPerPage, (page-1)*ItemsPerPage). Where("follow.follow_id=?", u.ID) if setting.UsePostgreSQL { - sess = sess.Join("LEFT", "follow", `"user".id=follow.user_id`) + sess = sess.Join("LEFT", "follow", "`user`.id=follow.user_id") } else { - sess = sess.Join("LEFT", "follow", "user.id=follow.user_id") + sess = sess.Join("LEFT", "follow", "`user`.id=follow.user_id") } return users, sess.Find(&users) } @@ -393,9 +393,9 @@ func (u *User) GetFollowing(page int) ([]*User, error) { Limit(ItemsPerPage, (page-1)*ItemsPerPage). Where("follow.user_id=?", u.ID) if setting.UsePostgreSQL { - sess = sess.Join("LEFT", "follow", `"user".id=follow.follow_id`) + sess = sess.Join("LEFT", "follow", "`user`.id=follow.follow_id") } else { - sess = sess.Join("LEFT", "follow", "user.id=follow.follow_id") + sess = sess.Join("LEFT", "follow", "`user`.id=follow.follow_id") } return users, sess.Find(&users) } |