Created
July 8, 2017 05:52
-
-
Save leopard627/b55268ca308b5547b76f3597a917ff54 to your computer and use it in GitHub Desktop.
Beego Practice..
This file contains hidden or 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
func (this *TestController) Show3() { | |
o := orm.NewOrm() | |
var arc []*models.Archives | |
o.QueryTable("go_archives").Filter("Id__gt", 1).RelatedSel().All(&arc)//使用RelatedSel将关联的arctype也查出来,也就是left join arctype as T1 on T1.id=go_archives.arctype_id | |
arc3 := arc[0] | |
fmt.Println(arc3.Arctype.Typename) | |
}// 이런식으로해서 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment