We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
{ "code": 200, "msg": "ok", "data": { "id": 2, "created_on": 0, "modified_on": 0, "deleted_on": 0, "tag_id": 3, "tag": { "id": 0, "created_on": 0, "modified_on": 0, "deleted_on": 0, "name": "", "created_by": "", "modified_by": "", "state": 0 }, ...
The text was updated successfully, but these errors were encountered:
err := db.Where("id = ? AND deleted_on = ? ", id, 0).First(&article).Related(&article.Tag).Error
这里where查询id时,似乎同时查询了blog_tag和blog_article两张表的id。当tag_id和article id一致时,才会返回正确的tag数据。
Sorry, something went wrong.
0505512
@fubd 已修复,感谢反馈 :)
No branches or pull requests
{
"code": 200,
"msg": "ok",
"data": {
"id": 2,
"created_on": 0,
"modified_on": 0,
"deleted_on": 0,
"tag_id": 3,
"tag": {
"id": 0,
"created_on": 0,
"modified_on": 0,
"deleted_on": 0,
"name": "",
"created_by": "",
"modified_by": "",
"state": 0
},
...
The text was updated successfully, but these errors were encountered: