@@ -18,7 +18,9 @@
t5.credential_number,
t6.name AS gender,
t3.name AS teacher_name,
- t.class_id,t.punishment_type_id,
+ t.class_id,ifnull((SELECT punishment_type_id FROM base_punishment_student_handle
+ WHERE base_student_punishment_info_id = t.id
+ ORDER BY adjust_date DESC,id desc LIMIT 1), t.punishment_type_id) as punishment_type_id,
(SELECT IF(a1.adjust_type = 3, REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),CONCAT(REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),'(',a2.punishment_type,')')) FROM base_punishment_student_handle a1
LEFT JOIN base_punishment_type a2 ON a1.punishment_type_id = a2.id
WHERE base_student_punishment_info_id = t.id