Fixed GetOtherAccountsFor query

This commit is contained in:
Torkel Ödegaard
2014-12-16 09:06:49 +01:00
parent 705455d5d6
commit 53b00d80d6
2 changed files with 4 additions and 49 deletions
+2 -1
View File
@@ -96,8 +96,9 @@ func AddCollaborator(collaborator *models.Collaborator) error {
func GetOtherAccountsFor(accountId int64) ([]*models.OtherAccount, error) {
collaborators := make([]*models.OtherAccount, 0)
sess := x.Table("collaborator")
sess.Join("INNER", "account", "account.id=collaborator.account_Id")
sess.Join("INNER", "account", "collaborator.for_account_id=account.id")
sess.Where("account_id=?", accountId)
sess.Cols("collaborator.id", "collaborator.role", "account.email")
err := sess.Find(&collaborators)
return collaborators, err
}