Created
January 19, 2020 13:20
-
-
Save yutakahashi114/4896c8640224e8805ff2f2204dda1cf3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type joinedUser struct { | |
User user `xorm:"extends"` | |
Friend friend `xorm:"extends"` | |
} | |
func (joinedUser) TableName() string { | |
return "friends" | |
} | |
{ | |
jus := []joinedUser{} | |
err = engine. | |
Join("INNER", "users", "users.id = friends.friend_id"). | |
Find(&jus) | |
if err != nil { | |
log.Println(err) | |
return | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment