我正在尝试使用单个API调用获取所有用户朋友的纬度/经度.我相信我需要编写一个多查询FQL语句,但我无法使语法正确.
我相信这两个查询需要如下所示:
'"friends":"SELECT uid,current_location FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())"'
'"location":"SELECT location FROM page WHERE id IN (SELECT current_location_id FROM #friends)"';
Run Code Online (Sandbox Code Playgroud)
我的问题是,我需要在第一个查询中获取current_location的ID,以便我可以在第二个查询中引用它,但我只知道如何获取包含id的数组.
谢谢你的帮助!
澄清:
我不想让朋友办理登机手续.相反,我想在Geo地图上绘制所有用户朋友的"current_location"(即他们居住的地方).我可以使用以下FQL查询获取用户的"current_location":
"SELECT uid,sex,current_location FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())"
Run Code Online (Sandbox Code Playgroud)
此查询返回以下数组:
[current_location] => Array
(
[city] => New York
[state] => New York
[country] => United States
[zip] =>
[id] => 108424279189115
[name] => New York, New York
)
Run Code Online (Sandbox Code Playgroud)
其中不包含current_location的经度和纬度(上例中的纽约)
因此,我现在需要获取current_location的ID(例如108424279189115)并运行第二个FQL查询,例如:
"SELECT location,name …Run Code Online (Sandbox Code Playgroud)