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]