From 06db1820d619dafb495f741340e760caf2e2ef76 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 26 Jun 2019 10:14:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AA=E5=88=86=E7=8F=AD=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=9C=A8=E5=AD=90=E5=88=86=E7=8F=AD=E5=89=8D=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 226a45570..93b8bfc50 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -247,15 +247,15 @@ module CoursesHelper def left_group_info course group_info = [] 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| 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, second_category_url: "/courses/#{@course.id}/course_groups/#{course_group.id}"} 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 group_info end