|
|
@ -56,7 +56,7 @@ class Myshixun < ApplicationRecord
|
|
|
|
# status:0 可以测评的; 1 正在测评的; 2评测通过的; 3未开启的
|
|
|
|
# status:0 可以测评的; 1 正在测评的; 2评测通过的; 3未开启的
|
|
|
|
# 如果都完成,则当前任务为最后一个任务
|
|
|
|
# 如果都完成,则当前任务为最后一个任务
|
|
|
|
def current_task games
|
|
|
|
def current_task games
|
|
|
|
current_game = games.select{|game| game.status == 1 || game.status == 0}.first
|
|
|
|
current_game = games.select{|game| game.status == 1 || game.status == 0}.last
|
|
|
|
if current_game.blank?
|
|
|
|
if current_game.blank?
|
|
|
|
current_game = games.last
|
|
|
|
current_game = games.last
|
|
|
|
end
|
|
|
|
end
|
|
|
|