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