From 40b123236e6f27a93ee3c15246ec2ee15abffafe Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 7 Mar 2020 19:52:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=9B=86=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E7=9A=84=E4=B8=AA=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/hack_user_lastest_codes_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index 353833ee2..92baa6460 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -72,8 +72,8 @@ class HackUserLastestCodesController < ApplicationController def record_detail @hack_user = HackUserCode.find params[:id] set = HackSet.find_by(id: @hack_user.error_test_set_id) - @pass_set_count = set ? set.position - 1 : 0 @set_count = @hack_user.hack.hack_sets.count + @pass_set_count = set ? set.position - 1 : (@hack_user.status == 0 ? @set_count : 0) @my_hack = @hack_user.hack_user_lastest_code end