我正在加入两个都有tag_id的表(即album.tag_id和photo.tag_id)
function GetJoined()
{
return Album::join('photos', 'photos.tag_id', '=', 'albums.tag_id')
}
但我不希望结果查询一直提醒我这是两个表的连接
GetJoined()->where('tag_id', 1);
将会像
一样'tag_id' in where clause is ambiguous
有什么建议吗?