我无法理解 Laravel 中 API 的响应,这令人困惑。
我期待这个输出
{
"month": "January",
"year": 2020,
"history_data": [
{
"id": 27,
"jurnal_id": 12313,
"name": "Transaksi RAHN FLEKSI",
"point": 500,
"status": "SUKSES",
"created_at": "2020-03-18 17:03:26",
"updated_at": "2020-03-18 17:03:26",
},
]
},
{
"month": "February",
"year": 2020,
"history_data": [
{
"id": 27,
"jurnal_id": 1231313,
"name": "Transaksi RAHN FLEKSI",
"point": 500,
"status": "SUKSES",
"created_at": "2020-03-18 17:03:26",
"updated_at": "2020-03-18 17:03:26",
}
],
{
"month": "February",
"year": 2021,
"history_data": [
{
"id": 182,
"jurnal_id": 13213,
"name": "Transaksi RAHN FLEKSI",
"point": 500,
"status": "SUKSES",
"created_at": "2021-02-18 17:03:26",
"updated_at": "2021-02-18 17:03:26",
},
{
"id": 1812313,
"jurnal_id": 12313313,
"name": "Transaksi RAHN FLEKSI",
"point": 500,
"status": "SUKSES",
"created_at": "2021-02-18 17:03:26",
"updated_at": "2021-02-18 17:03:26",
}
]
{
"month": "March",
"year": 2021,
"history_data": [
{
"id": 183,
"jurnal_id": 132313,
"name": "Transaksi RAHN FLEKSI",
"point": 500,
"status": "SUKSES",
"created_at": "2021-03-18 17:03:26",
"updated_at": "2021-03-18 17:03:26",
}
]
}
如果我没记错的话,“history_data”按年和月分组。但是,我仍然得到如下回复
有只小跳蛙