我试图访问名为" MemberID"的数组中的Int。但它位于另一个数组内的数组内,如下所示:
{
"userMessage" : "ErnollmentSuccess",
"data" : {
"memberId" : 3635,
"refreshToken" : "fc22418f1267488485e5f99a510b1618",
"tokenType" : "bearer",
"accessToken" : "1ce9744bd2604392adc0e896bba24f2a",
"expiresIn" : 1209600
}
有谁知道如何提取memberID值?
答案 0 :(得分:2)
给定类型为JSON的json值,其内容为
if let memberID = json["data"]["memberid"].int {
print(memberID)
}
你可以写这个
@customers =
Customer.includes(:phone_numbers, :emails)
.select("first_name, last_name, zip_code, customers.id, street1, street2")
.where(:merchant_id => environment)
.where("phone_numbers.number ~* :key",
:key => key, :digits => digits)