我的stock_comments表格如下
id|user_id|stock_id|comment|
1 | 8 | 6 | stock comment one
2 | 8 | 6 | stock comment two
3 | 8 | 6 | stock comment three
4 | 8 | 6 | stock comment four
5 | 9 | 7 | stock comment one
6 | 9 | 7 | stock comment two
我的控制器如下
$stock_comments = StockComment::where('stock_id' , $id)->where('comment_type' , 'recommendation')->groupBy('current_id')->orderBy('id', 'desc')->get();
如何根据个人user_id保留数组注释? 请帮帮我。