4

这是代码。结果我想看到我的对话和我朋友的对话。对于对话历史记录功能我该怎么做?

SELECT message_id, thread_id, author_id, body, created_time, viewer_id 
FROM message WHERE thread_id IN 
(SELECT thread_id, subject, recipients FROM thread WHERE folder_id =0 )
AND author_id = 'xxxxxxxxxxxxxxx' ORDER BY created_time DESC LIMIT 0,25

此代码仅返回我的朋友数据。

4

2 回答 2

0

您已将返回的评论限制为仅由您的朋友撰写的评论。

改变

AND author_id = FRIEND_ID

AND (author_id = FRIEND_ID OR author_id = me())

在查询的 `WHERE 子句中。

于 2012-08-23T16:54:20.777 回答
0

使用您的原始查询获取 thread_id,然后尝试此 fql 查询。我认为 thread_id 属于整个对话

SELECT message_id, thread_id,source,author_id,body,created_time,viewer_id FROM
message WHERE thread_id=THREAD_id AND (author_id=FRIEND_ID OR 
author_id=me() )  ORDER BY created_time DESC LIMIT 0,25
于 2014-02-04T08:19:03.267 回答