From 7a5499a62229078020da5c6e068caa6c836790d0 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 10 Sep 2019 09:30:04 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=88=90=E7=BB=A9?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=8C=87=E5=AF=BC=E8=80=81=E5=B8=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/competition_team.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/competition_team.rb b/app/models/competition_team.rb index e2551710..7b0e6d50 100644 --- a/app/models/competition_team.rb +++ b/app/models/competition_team.rb @@ -11,7 +11,8 @@ class CompetitionTeam < ActiveRecord::Base # attr_accessible :invite_code, :name, :team_type def teacher - User.where(:id => self.teacher_id).first + teacher_id = self.teachers.first&.user_id + User.find_by(id: teacher_id) end def group_members From 78f1d0610f4ea89cce068d71f7eabe45d583584a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 10 Sep 2019 09:34:38 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E6=88=90=E7=BB=A9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/competition_team.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/competition_team.rb b/app/models/competition_team.rb index 7b0e6d50..a8f48b3e 100644 --- a/app/models/competition_team.rb +++ b/app/models/competition_team.rb @@ -12,7 +12,7 @@ class CompetitionTeam < ActiveRecord::Base def teacher teacher_id = self.teachers.first&.user_id - User.find_by(id: teacher_id) + User.where(id: teacher_id).first end def group_members From a5298562748aeef63cab8b1a04f2e8339a8fe624 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 18 Sep 2019 17:24:41 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 96dea860..b766ad07 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -1746,7 +1746,7 @@ end # 删除 def delete_applied_departments - transaction do + ActiveRecord::Base.transaction do applied_department = ApplyAddDepartment.find params[:depart_id] applied_message = AppliedMessage.where(:applied_id => applied_department.id, :applied_type => "ApplyAddDepartment") applied_message.update_all(:status => 3) 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 4/6] =?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 5/6] =?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 From 1079d7c70ef696ac950793d4855f05f533a0362e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 20 Sep 2019 11:08:36 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E9=9A=90=E8=97=8F=E4=BC=97=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_logined_header.html.erb | 2 +- app/views/layouts/_unlogin_header.html.erb | 2 +- public/react/src/modules/tpm/NewHeader.js | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index e171b517..3e57fce3 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -25,7 +25,7 @@