From 86adedc617ca2b7dead9902307c24b212058c0f6 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 10 Mar 2020 01:56:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=85=B3=E5=8D=A1=E4=BA=BA?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/index.json.jbuilder | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/challenges/index.json.jbuilder b/app/views/challenges/index.json.jbuilder index 6613dd888..eae72dad2 100644 --- a/app/views/challenges/index.json.jbuilder +++ b/app/views/challenges/index.json.jbuilder @@ -17,9 +17,10 @@ if @challenges.present? json.name challenge.subject json.score challenge.score #json.passed_count @pass_games_map.fetch(challenge.id, 0) - json.passed_count challenge.user_passed_count + user_passed_count = challenge.user_passed_count + json.passed_count user_passed_count #json.playing_count @play_games_map.fetch(challenge.id, 0) - json.playing_count challenge.playing_count + json.playing_count (challenge.games.count - user_passed_count) json.name_url shixun_challenge_path(challenge, shixun_identifier: @shixun.identifier) json.open_game challenge.open_game(@shixun) #json.open_game challenge.open_game(@shixun, @user.id)