评论关卡位置为空时,默认第一关

'
dev_haigong
daiao 6 years ago
parent a71e82ae78
commit 3ce5c0d7b5

@ -128,7 +128,8 @@ class ShixunsService
manager = current_user.manager_of_shixun?(dis, current_user) manager = current_user.manager_of_shixun?(dis, current_user)
game_url = game_url =
if manager if manager
challenge_id = dis.challenges.where(position: d.position).pluck(:id).first position = d.position.nil? ? 1 : d.position
challenge_id = dis.challenges.where(position: position).pluck(:id).first
game_identifier = Game.where(user_id: current_user, game_identifier = Game.where(user_id: current_user,
challenge_id: challenge_id).pluck(:identifier).first challenge_id: challenge_id).pluck(:identifier).first
"/tasks/#{game_identifier}" "/tasks/#{game_identifier}"

Loading…
Cancel
Save