From 4b4a0d52e6a8373b67625bd463e7e90b163501b5 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 8 Jul 2019 11:43:12 +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_work_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 01299409..d8b572ea 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -87,8 +87,8 @@ class StudentWorkController < ApplicationController # 当前用户评测最大次数 @user_evaluate_count = 0 - if myshixun.user_id == @work.user.id - @user_evaluate_count = @myshixun.games.sum(:evaluate_count).to_i + if @myshixun.user_id == @work.user.id + @user_evaluate_count = @myshixun.games.pluck(:evaluate_count).sum.to_i end unless params[:pdf]