>div class="s-table-container">
id | agent_id | 货币||
---|---|---|---|
1 | A0001 | IDR||
2 | A0002 | MYR||
3 | A0001 | THB |
找到了这个问题的解决方案
$output = $output
->get()
->groupby('agent_id')
->map(function($rows){
return [
"agent_id" => $rows[0]['agent_id'],
"currency" => $rows->pluck('currency'),
];
});