|
|
@ -79,14 +79,14 @@ class Challenge < ApplicationRecord
|
|
|
|
# 允许跳关则直接开启
|
|
|
|
# 允许跳关则直接开启
|
|
|
|
game = games.where(user_id: user_id).take
|
|
|
|
game = games.where(user_id: user_id).take
|
|
|
|
if game.blank?
|
|
|
|
if game.blank?
|
|
|
|
self.position == 1 ? 1 : 0
|
|
|
|
position == 1 ? 1 : 0
|
|
|
|
elsif game.status == 2
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if shixun.task_pass
|
|
|
|
if game.status == 3
|
|
|
|
1
|
|
|
|
shixun.task_pass ? 1 : 0
|
|
|
|
|
|
|
|
elsif game.status == 2
|
|
|
|
|
|
|
|
2
|
|
|
|
else
|
|
|
|
else
|
|
|
|
0
|
|
|
|
1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|