0
laravel에 조인 게시물, 댓글 및
- 게시물 테이블과 동일한 테이블 답글하지만 게시물의 응답
- 게시물 테이블이 응답 덧글
- 답글 테이블도 댓글이 있습니다
- 댓글 테이블은 댓글 테이블 및 게시물 테이블 의 의견을 저장하는 것입니다 그때 또한 해당 게시물이 포함 된 게시물의 응답이 코멘트가 있고, 결과 게시물 고유해야합니다 비록 의견이 모든 게시물을 얻을하고자은
- ...
이 내가 시도 무엇 ::
$RC = DB::table('comments')
->join('replies','comments.reply_id','=','replies.id')
->where('comments.handle',$request->handle)
->where('replies.handle','!=',$request->handle)
->groupBy('replies.post_id')
->get(['replies.post_id']);
$PC = DB::table('comments')
->join('posts', 'comments.post_id', '=', 'posts.id')
->where('comments.handle',$request->handle)
->where('posts.handle','!=',$request->handle)
->groupBy('comments.post_id')
->get(['comments.post_id']);
을 원하는 얻을이 코드를 사용하고 있습니다? –
공식 문서를 읽으십시오 : https://laravel.com/docs/5.2/eloquent-relationships를 읽고 그것에 관해서 한 일을 – SUB0DH
@ShaunakShukla 제가 게시 한 것을 게시했습니다 – BCPNAYAK