【发布时间】:2018-07-10 21:25:14
【问题描述】:
我为获取 cmets 编写查询并为 post 回复commants。 评论和回复 cmets 放在 cmets 表上。 我的查询是:
$comments = Comment::with(['reply_comments', 'user', 'scores'])
->where('comments.place_id', $place[0]->id)
->where('status', 1)
->orderBy('id', 'desc')
->get();
虽然在 where 条件下检查 cmets 的状态,但此条件在 cmets 上完成,但不在 replyComment 上。 这意味着在看不到状态时返回回复评论。 如何为此更改查询或条件。
【问题讨论】: