|
|
@@ -19,10 +19,10 @@
|
|
|
t6.name AS gender,
|
|
|
t3.name AS teacher_name,
|
|
|
t.class_id,t.punishment_type_id,
|
|
|
- (SELECT CONCAT(REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),'(',a2.punishment_type,')') as adjust_type FROM base_punishment_student_handle a1
|
|
|
- INNER JOIN base_punishment_type a2 ON a1.punishment_type_id = a2.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
|
|
|
- ORDER BY adjust_date DESC,a1.id DESC LIMIT 1) as adjust_type,
|
|
|
+ ORDER BY adjust_date DESC,a1.id DESC LIMIT 1) AS adjust_type,
|
|
|
(SELECT adjust_date FROM base_punishment_student_handle
|
|
|
WHERE base_student_punishment_info_id = t.id
|
|
|
ORDER BY adjust_date DESC,id desc LIMIT 1) as adjust_date,
|
|
|
@@ -104,10 +104,10 @@
|
|
|
t3.name AS teacher_name,
|
|
|
t.class_id,
|
|
|
t8.name as major,
|
|
|
- (SELECT CONCAT(REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),'(',a2.punishment_type,')') as adjust_type FROM base_punishment_student_handle a1
|
|
|
- INNER JOIN base_punishment_type a2 ON a1.punishment_type_id = a2.id
|
|
|
- WHERE base_student_punishment_info_id = t.id
|
|
|
- ORDER BY adjust_date DESC,a1.id DESC LIMIT 1) as adjust_type,
|
|
|
+ (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
|
|
|
+ ORDER BY adjust_date DESC,a1.id DESC LIMIT 1) AS adjust_type,
|
|
|
(SELECT adjust_date FROM base_punishment_student_handle
|
|
|
WHERE base_student_punishment_info_id = t.id
|
|
|
ORDER BY adjust_date DESC,id desc LIMIT 1) as adjust_date,
|