From a03448ed97ebdc51583f26895d2e85ecb8d8e400 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 27 Aug 2019 18:51:55 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/graduation_works_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/graduation_works_controller.rb b/app/controllers/graduation_works_controller.rb index a4a59a3f5..e9e07cc0d 100644 --- a/app/controllers/graduation_works_controller.rb +++ b/app/controllers/graduation_works_controller.rb @@ -274,7 +274,7 @@ class GraduationWorksController < ApplicationController @is_author = @work.user_id == current_user.id @work_members = @task.task_type == 1 ? [] : @task.graduation_works.where.not(user_id: @work.user_id). where(group_id: @work.group_id).includes(:user) - @attachments = @work.attachments.where.not(attachtype: 7) + @attachments = @work.attachments.where.not(attachtype: 7).or(attachtype: nil) end def comment_list From 815df50ad1f410756a66b533fe77b7fe78a77dc9 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 27 Aug 2019 18:54:47 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/graduation_works_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/graduation_works_controller.rb b/app/controllers/graduation_works_controller.rb index e9e07cc0d..204e0e5d4 100644 --- a/app/controllers/graduation_works_controller.rb +++ b/app/controllers/graduation_works_controller.rb @@ -274,7 +274,7 @@ class GraduationWorksController < ApplicationController @is_author = @work.user_id == current_user.id @work_members = @task.task_type == 1 ? [] : @task.graduation_works.where.not(user_id: @work.user_id). where(group_id: @work.group_id).includes(:user) - @attachments = @work.attachments.where.not(attachtype: 7).or(attachtype: nil) + @attachments = @work.attachments.where("attachtype != 7 or attachtype is null") end def comment_list From a7d4d41312b48db8469a871dcf7e9ea680c7ee49 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 28 Aug 2019 13:52:08 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=AD=A6=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E8=B6=85=E5=87=BA=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/controllers/subjects_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 2f3bbd21c..d97b7172c 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -450,7 +450,7 @@ class SubjectsController < ApplicationController @time = 0 @user_tags = [] else - pass_challenge_ids = pass_games.map(&:challenge_id) + pass_challenge_ids = pass_games.map(&:challenge_id).uniq # 按道理是不用去重的,但是历史数据与重复 subject_challenge_count = @subject.shixuns.sum(:challenges_count) # 用户通关获得的标签 @user_tags = ChallengeTag.where(challenge_id: pass_challenge_ids).pluck(:name) From 7102d3fe3427145e7f27376b8e03eb1afa7e792e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 28 Aug 2019 14:24:15 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E9=95=9C=E5=83=8F=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 177eb1a42..7c8015894 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -416,7 +416,7 @@ class ApplicationController < ActionController::Base # 实训主类别列表,自带描述 def shixun_main_type list = [] - mirrors = MirrorRepository.select([:id, :type_name]).published_main_mirror + mirrors = MirrorRepository.select([:id, :type_name, :description]).published_main_mirror mirrors.try(:each) do |mirror| list << {id: mirror.id, type_name: mirror.type_name, description: mirror.try(:description)} end