代码如下:
SELECT
r.report_id,
r.report_user, //这个是举报者的userid
u1.user_name AS reporter,
r.post_id,
p.user_id, //这个是帖子作者userid
u2.user_name AS author,
FROM
report r
JOIN post p ON r.post_id= p.post_id
JOIN user_info u1 ON r.report_user= u1.user_id
JOIN user_info u2 ON u2.user_id = p.user_id