您如何根据当前位置获取事件?我已经尝试通过 FQL,但在查询中,“where”子句必须是可索引的列,但我需要搜索半径为 5 英里的所有事件。
问问题
682 次
1 回答
1
嗯,是这样的:
$lat = "47.960";
$long = "12.091";
// using offset gives us a "square" on the map from where to search the events
$offset = 0.4;
$events = 'SELECT pic_big, name, venue, location, start_time, eid FROM event WHERE eid IN (SELECT eid FROM event_member WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND venue.longitude \''. ($long-$offset) .'\' AND venue.latitude > \''. ($lat-$offset) .'\'. $limit;
但为此,您需要获取您正在搜索的位置的纬度和经度。
希望在某种程度上有所帮助
于 2012-04-05T12:15:28.707 回答