实训路径报错

dev_aliyun
daiao 5 years ago
parent 4b0d3fdf6c
commit e6cb59cfef

@ -129,7 +129,8 @@ class Myshixun < ActiveRecord::Base
if current_game.blank?
current_game = Game.find_by_sql("SELECT g.* FROM games g, challenges c where g.myshixun_id=#{self.id} and g.challenge_id = c.id and g.status = 2 order by c.position desc").first
end
return current_game
return current_game.blank? ? games.first : current_game
#
# if self.status == 1
# current_game = Game.find_by_sql("SELECT g.* FROM games g, challenges c where g.myshixun_id=#{self.id} and g.challenge_id = c.id and g.status = 2 order by c.position desc").first

Loading…
Cancel
Save