Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何使用模型方法进行关联查询或者预加载? #91

Open
waset opened this issue Nov 25, 2024 · 2 comments
Open

如何使用模型方法进行关联查询或者预加载? #91

waset opened this issue Nov 25, 2024 · 2 comments

Comments

@waset
Copy link

waset commented Nov 25, 2024

gorm 的模型关联方法 Preload 使用方式

db.Model(&User{}).Preload("CreditCard").Find(&users)

@waset
Copy link
Author

waset commented Nov 25, 2024

@afumu @bingtianyiyan 请问是需要结合 gorm 的原方法使用吗?

@afumu
Copy link
Member

afumu commented Dec 7, 2024

@waset 是的哈,目前只是支持单表查询

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants