SELECT
b.id,
a.student_name AS '学生姓名',
a.mobile AS '学生手机',
b.teacher_id,
t.realname AS '教师姓名',
t.mobile AS '教师手机',
b.course_name AS '课程名称',
b.course_type AS '课程类型',
b.if_confirm AS '确认时间',
b. STATUS AS '课程状态',
b.course_id,
b.create_time,
b.pay_time,
b.request_id,
b.source_price,
b.start_time,
b.current_price,
b.trx_status
FROM
edu_trxorder a
RIGHT JOIN edu_trxorder_detail b ON a.id = b.trxorder_id
LEFT JOIN (
SELECT
a.realname,
c.id,
b.mobile
FROM
user_expand a
INNER JOIN user_user b ON a.user_id = b.id
INNER JOIN edu_teacher c ON c.user_id = a.user_id
WHERE
b.user_type = 1
ORDER BY
a.id DESC
) AS t ON t.id = b.teacher_id
ORDER BY
b.id DESC