0

我有一个数据库表如下

帖子表 评论表 用户表 页表 喜欢表
ID ID ID ID ID
用户身份 用户身份 姓名 page_name liker_id
内容 评论 电子邮件 liker_type
created_at created_at 喜欢的_id
喜欢的类型

Likables中的liker_type 列可能是postcommentliker_type列可能是pageuser

我想从PostComment模型中访问总点赞数以及每个页面或用户的集合。

同样,我想获得用户页面喜欢的帖子评论的集合。

有可能有这样的吗?我怎样才能为这个场景建立关系?

4

0 回答 0