diff --git a/app/views/homework_commons/group_list.json.jbuilder b/app/views/homework_commons/group_list.json.jbuilder index dcc04e761..5e6c63556 100644 --- a/app/views/homework_commons/group_list.json.jbuilder +++ b/app/views/homework_commons/group_list.json.jbuilder @@ -8,10 +8,13 @@ json.group_list do end # 未分班展示情况放在最后 if @course_groups.count < @limit.to_i - json.ungroup_list do - json.id 0 - json.name "未分班" - json.work_count homework_ungroup_works_count @homework, @ungroup_user_ids - json.last_review_time ungroup_last_review_time @homework + ungroup_work_count = homework_ungroup_works_count(@homework, @ungroup_user_ids) + if ungroup_work_count > 0 + json.ungroup_list do + json.id 0 + json.name "未分班" + json.work_count ungroup_work_count + json.last_review_time ungroup_last_review_time @homework + end end end \ No newline at end of file