From b86b7ac3528b56868a510a94054c4b9c75498d65 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 26 Jun 2019 15:53:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_works_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 7e23443d2..31c198fd8 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -434,7 +434,7 @@ class StudentWorksController < ApplicationController # 用户最大评测次数 if @games - @user_evaluate_count = @games.sum(:evaluate_count) + @user_evaluate_count = @games.pluck(:evaluate_count).sum @games = @games.includes(:challenge, :game_codes, :outputs) else @user_evaluate_count = 0 @@ -450,7 +450,7 @@ class StudentWorksController < ApplicationController @games = @work.myshixun.games.includes(:challenge, :game_codes, :outputs) if @work.myshixun # 用户最大评测次数 - @user_evaluate_count = @games.sum(:evaluate_count) if @games + @user_evaluate_count = @games.pluck(:evaluate_count).sum if @games # 图形效率图的数据 @echart_data = student_efficiency(@homework, @work) @myself_eff = @echart_data[:efficiency_list].find { |item| item.last == @user.id }