From 665791f4720cf24050ccc4bef4159652856ca266 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 26 Jun 2019 17:12:20 +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/models/myshixun.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/myshixun.rb b/app/models/myshixun.rb index e4573f3dd..a1aca3253 100644 --- a/app/models/myshixun.rb +++ b/app/models/myshixun.rb @@ -74,12 +74,12 @@ class Myshixun < ApplicationRecord # 个人实训得分 def total_score - self.games.select{|game| game.status = 2 && game.final_score > 0}.pluck(:final_score).sum.to_i + self.games.select{|game| game.status == 2 && game.final_score > 0}.pluck(:final_score).sum.to_i end # 个人通关数 def passed_count - self.games.select{|game| game.status = 2}.size + self.games.select{|game| game.status == 2}.size end # 通关时间 @@ -94,7 +94,7 @@ class Myshixun < ApplicationRecord # 通关总耗时 def total_cost_time - self.games.select{|game| game.status = 2}.map(&:cost_time).sum.to_i + self.games.select{|game| game.status == 2}.map(&:cost_time).sum.to_i end end