示例#1
0
文件: estJoin.go 项目: winxxp/tests
func join3(engine *xorm.Engine, t *testing.T) {
	_, err := engine.Join("LEFT", "userdetail", "userinfo.id=userdetail.id").Get(&Userinfo{Uid: 1})
	if err != nil {
		t.Error(err)
		panic(err)
	}
}
示例#2
0
文件: estJoin.go 项目: winxxp/tests
func joinSameMapper(engine *xorm.Engine, t *testing.T) {
	users := make([]Userinfo, 0)
	err := engine.Join("LEFT", "`Userdetail`", "`Userinfo`.`(id)`=`Userdetail`.`Id`").Find(&users)
	if err != nil {
		t.Error(err)
		panic(err)
	}
}
示例#3
0
func joinCount(engine *xorm.Engine, t *testing.T) {
	count, err := engine.Join("LEFT", "userdetail", "userinfo.id=userdetail.id").Count(&Userinfo{Uid: 1})
	if err != nil {
		t.Error(err)
		panic(err)
	}
	fmt.Println(count)
}
示例#4
0
文件: estJoin.go 项目: winxxp/tests
func join2(engine *xorm.Engine, t *testing.T) {
	users := make([]Userinfo, 0)
	err := engine.Join("LEFT", "userdetail", "userinfo.id=userdetail.id").Find(&users,
		&Userinfo{Uid: 1})
	if err != nil {
		t.Error(err)
		panic(err)
	}
}
示例#5
0
func join(engine *xorm.Engine, t *testing.T) {
	users := make([]Userinfo, 0)
	err := engine.Join("LEFT", "userdetail", "userinfo.id=userdetail.id").Find(&users)
	if err != nil {
		t.Error(err)
		panic(err)
	}

	join2(engine, t)
	join3(engine, t)
	joinCount(engine, t)
	joinCount2(engine, t)
}