实训tpi

This commit is contained in:
daiao 2017-04-01 10:47:11 +08:00
parent 8336110787
commit 0fd0081066
1 changed files with 2 additions and 1 deletions

View File

@ -13,7 +13,8 @@ class Myshixun < ActiveRecord::Base
games = self.games games = self.games
current_game = games.select{|game| game.status==1 || game.status==0}.first current_game = games.select{|game| game.status==1 || game.status==0}.first
if current_game.blank? if current_game.blank?
current_game = games.last passed_games = games.select{|game| game.status==2}
passed_games.last
end end
return current_game return current_game
end end