我想在我已经评论过的文章中检索每个用户的评论。
我有3个表:个人资料,评论和期刊。
代码下面的:
$posters =\DB::table('comments')
->select('comments.*', 'profiles.name')
->leftjoin('journals', 'comments.journal_id','=','journals.id')
->join('profiles', 'comments.profil_id','=','profiles.id')
->where('journals.profile_id', Auth::user()->id)
->orwhere('comments.profil_id',Auth::user()->id)->where('comments.journal_id','=','journals.id')
->get();