在我的 api 中,我有一个这样的 JSON 输出;
{
"restaurants": [{
"Restaurant": {
"id": "3",
"name": "...",
"slug": "...",
"phone": "2161234567",
"address": "...",
"city_id": "34",
"county_id": "426",
"discount_type_id": null,
"discount": "",
"people_limit": "2",
"reservations_required": false,
"lat": "41.015608",
"lon": "28.934834",
"about": "...",
"logo": "...",
"logo_dir": "3",
"photo_1": "...",
"photo_2": null,
"photo_3": null,
"photo_dir": "3",
"created": "2012-11-30 16:30:21",
"modified": "2012-11-30 20:43:50",
"deleted": true
},
"AvailabilityRestriction": [{
"id": "1",
"title": "...",
"AvailabilityRestrictionRestaurant": {
"id": "28",
"restaurant_id": "3",
"availability_restriction_id": "1"
}
}],
"CuisineTag": [{
"id": "3",
"name": "...",
"CuisineTagRestaurant": {
"id": "47",
"restaurant_id": "3",
"cuisine_tag_id": "3"
}
}]
},
...
}
餐厅有许多美食标签和可用性限制。还有一个城市表......同步它们的最佳方式是什么?
我必须先同步城市、美食标签和可用性限制,然后在创建餐厅时我会匹配它们?这是正确的方法吗?
谢谢。