whusnoopy
2022-04-14 19:14:48 +08:00
做过 BBS 维护,你这个情况多加几个 id 是不是就能解决
首先回复和评论隶属的主贴叫 topic_id ,然后每个回复或评论都有自己独立的 post_id ,如果是楼中楼,每层楼的 reply_id 是他上一级楼的 post_id ,如果就是主楼 reply_id 置空或也指向自己 post_id 都可以,然后楼中楼所有楼都增加一个 thread_id 指向楼中楼的主楼
```
topic_id1
+- topic_id_1, post_id_2, reply_id_2, thread_id_2
|+- topic_id_1, post_id_3, reply_id_2, thread_id_2
||+- topic_id_1, post_id_4, reply_id_3, thread_id_2
|+- topic_id_1, post_id_5, reply_id_2, thread_id_2
|+- topic_id_1, post_id_6, reply_id_2, thread_id_2
+- topid_id_1, post_id_7, reply_id_7, thread_id_7
```
这个灵魂描述看能不能看懂