未分班显示在子分班前面

dev_course
cxt 6 years ago
parent d6326a553c
commit 06db1820d6

@ -247,15 +247,15 @@ module CoursesHelper
def left_group_info course def left_group_info course
group_info = [] group_info = []
if course.course_groups_count > 0 if course.course_groups_count > 0
none_group_count = course.students.where(course_group_id: 0).size
group_info << {category_id: 0, category_name: "未分班", position: course.course_groups.pluck(:position).max.to_i + 1,
category_count: none_group_count, category_type: false,
second_category_url: "/courses/#{@course.id}/course_groups/0"}
course.course_groups.each do |course_group| course.course_groups.each do |course_group|
group_info << {category_id: course_group.id, category_name: course_group.name, position: course_group.position, group_info << {category_id: course_group.id, category_name: course_group.name, position: course_group.position,
category_count: course_group.course_members_count, category_type: false, category_count: course_group.course_members_count, category_type: false,
second_category_url: "/courses/#{@course.id}/course_groups/#{course_group.id}"} second_category_url: "/courses/#{@course.id}/course_groups/#{course_group.id}"}
end end
none_group_count = course.students.where(course_group_id: 0).size
group_info << {category_id: 0, category_name: "未分班", position: course.course_groups.pluck(:position).max.to_i + 1,
category_count: none_group_count, category_type: false,
second_category_url: "/courses/#{@course.id}/course_groups/0"}
end end
group_info group_info
end end

Loading…
Cancel
Save