-3
我得到如下所示的json數據。格式使用javascript的Muilty dimentional數組
[
{
"id":5,
"entity_id":122,
"entity_type":"STUDENT",
"edit_type":"UPDATE",
"created_by":122,
"created_date":"2017-04-04T18:30:00.000Z",
"change_log_id":2,
"field_name":"full_name",
"current_value":"cur14111r name",
"previous_value":"old11111 name"
},
{
"id":7,
"entity_id":122,
"entity_type":"STUDENT",
"edit_type":"UPDATE",
"created_by":122,
"created_date":"2017-04-04T18:30:00.000Z",
"change_log_id":2,
"field_name":"country",
"current_value":"Syriya11111",
"previous_value":"America1111"
},
{
"id":6,
"entity_id":122,
"entity_type":"STUDENT",
"edit_type":"UPDATE",
"created_by":122,
"created_date":"2017-04-04T18:30:00.000Z",
"change_log_id":2,
"field_name":"school",
"current_value":"HMV11111",
"previous_value":"TMV11111"
},
{
"id":8,
"entity_id":122,
"entity_type":"STUDENT",
"edit_type":"UPDATE",
"created_by":122,
"created_date":"2017-04-04T18:30:00.000Z",
"change_log_id":2,
"field_name":"nick_name",
"current_value":"Cokka1111",
"previous_value":"Kukka1111"
},
{
"id":1,
"entity_id":122,
"entity_type":"STUDENT",
"edit_type":"UPDATE",
"created_by":122,
"created_date":"2017-04-05T23:38:08.000Z",
"change_log_id":1,
"field_name":"full_name",
"current_value":"curr name",
"previous_value":"old name"
},
{
"id":3,
"entity_id":122,
"entity_type":"STUDENT",
"edit_type":"UPDATE",
"created_by":122,
"created_date":"2017-04-05T23:38:08.000Z",
"change_log_id":1,
"field_name":"country",
"current_value":"Syriya",
"previous_value":"America"
},
{
"id":2,
"entity_id":122,
"entity_type":"STUDENT",
"edit_type":"UPDATE",
"created_by":122,
"created_date":"2017-04-05T23:38:08.000Z",
"change_log_id":1,
"field_name":"school",
"current_value":"HMV",
"previous_value":"TMV"
},
{
"id":4,
"entity_id":122,
"entity_type":"STUDENT",
"edit_type":"UPDATE",
"created_by":122,
"created_date":"2017-04-05T23:38:08.000Z",
"change_log_id":1,
"field_name":"nick_name",
"current_value":"Cokka",
"previous_value":"Kukka"
}
]
我需要使用JavaScript. arr[change_log_id][id]["column_name"] = column vale;
目前還不清楚你在問什麼。 – epascarello
你從哪裏得到'column_name'? –
你期待什麼? – Prasath