select a.*,b.name as student_name,c.name as teacher_name from 问答表 left join 用户表 b on a.student_id=b.id left join 用户表 c on a.teacher_id=c.id