|
|
|
@ -129,9 +129,8 @@ class ShixunsService
|
|
|
|
|
game_url =
|
|
|
|
|
if manager
|
|
|
|
|
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,
|
|
|
|
|
challenge_id: challenge_id).pluck(:identifier).first
|
|
|
|
|
game_identifier = Game.find_by_sql("SELECT g.identifier FROM games g JOIN challenges c on g.challenge_id = c.id
|
|
|
|
|
WHERE c.shixun_id = #{dis.id} AND c.position = #{position} AND g.user_id = #{current_user.id}").first.try(:identifier)
|
|
|
|
|
"/tasks/#{game_identifier}"
|
|
|
|
|
else
|
|
|
|
|
""
|
|
|
|
|