From 7bb5548fe0dbcedbeccfde35401e6de5d6175c01 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 19 Sep 2019 17:52:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/ec_major_schools_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/ec_major_schools_helper.rb b/app/helpers/ec_major_schools_helper.rb index 512e1cef..ad104676 100644 --- a/app/helpers/ec_major_schools_helper.rb +++ b/app/helpers/ec_major_schools_helper.rb @@ -11,7 +11,7 @@ module EcMajorSchoolsHelper relations = EcGraduationRequirementCalculation.joins(ec_course_support: :ec_graduation_subitem_courses).where('ec_graduation_subitem_id in (?)', subitem_ids) - reached_map = relations.where(status: true).group('ec_graduation_subitem_id').count + reached_map = relations.where(status: true).group('ec_graduation_subitem_courses.ec_graduation_subitem_id').count reached_map.keys.size end From d86607d1b3b29298e8480628780648cd7dee2835 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 19 Sep 2019 17:53:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E8=AE=A4=E8=AF=81500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/ec_major_schools_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/ec_major_schools_helper.rb b/app/helpers/ec_major_schools_helper.rb index ad104676..d4e34219 100644 --- a/app/helpers/ec_major_schools_helper.rb +++ b/app/helpers/ec_major_schools_helper.rb @@ -9,7 +9,7 @@ module EcMajorSchoolsHelper subitem_ids = ec_year.ec_graduation_subitems.reorder(nil).pluck(:id) - relations = EcGraduationRequirementCalculation.joins(ec_course_support: :ec_graduation_subitem_courses).where('ec_graduation_subitem_id in (?)', subitem_ids) + relations = EcGraduationRequirementCalculation.joins(ec_course_support: :ec_graduation_subitem_courses).where('ec_graduation_subitem_courses.ec_graduation_subitem_id in (?)', subitem_ids) reached_map = relations.where(status: true).group('ec_graduation_subitem_courses.ec_graduation_subitem_id').count