Я использую ответ по умолчанию для пользователя в моем проекте в соответствии со следующей таблицей.
Таблица: ПОЛЬЗОВАТЕЛИ
| ID | ИМЯ | DEFAULTRESPONSE
Ответ по умолчанию содержит строку в формате JSON. Мне нужно изменить месяц и день всех родственных_дней с строки на int.
Вот пример предыдущего json:
[
{
"id":1,
"relatives_birthdays":[
{
"month":"8",
"day": "1",
"description": "Birthday mother"
},
{
"month":"3",
"day": "27",
"description": "Birthday brother"
},
{
"month":"4",
"day": "12",
"description": "Birthday father"
}
]
},
{
"id":2,
"relatives_birthdays":[
{
"month":"12",
"day": "11",
"description": "Birthday mother"
},
{
"month":"1",
"day": "2",
"description": "Birthday brother"
},
{
"month":"7",
"day": "18",
"description": "Birthday father"
}
]
}
]
А вот нужный мне json:
[
{
"id":1,
"relatives_birthdays":[
{
"month": 8,
"day": 1,
"description": "Birthday mother"
},
{
"month": 3,
"day": 27,
"description": "Birthday brother"
},
{
"month": 4,
"day": 12,
"description": "Birthday father"
}
]
},
{
"id":2,
"relatives_birthdays":[
{
"month": 12,
"day": 11,
"description": "Birthday mother"
},
{
"month": 1,
"day": 2,
"description": "Birthday brother"
},
{
"month": 7,
"day": 18,
"description": "Birthday father"
}
]
}
]
Какие-нибудь идеи относительно сценария, которые мне нужно выполнить, чтобы выполнить это?