From 21227f0ae51251505160c1cc5b27e7d021cc1341 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 3 Aug 2019 13:18:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E5=AE=9E=E8=AE=AD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7e9fd652b..7fedb4c5d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -62,15 +62,18 @@ module ApplicationHelper # shixun开启挑战对应的行为名及url def task_operation_url current_myshixun, shixun - url = "/shixuns/#{shixun.identifier}/shixun_exec" - name = - if current_myshixun.blank? - shixun.status == 0 ? "模拟实战" : "开启挑战" - elsif current_myshixun.status == 1 - "查看实战" + if current_myshixun.blank? + name = shixun.status == 0 ? "模拟实战" : "开启挑战" + url = "/shixuns/#{shixun.identifier}/shixun_exec" + else + identifier = current_myshixun.current_task(current_myshixun.games) + if current_myshixun.status == 1 + name = "查看实战" else - "继续挑战" + name = "继续挑战" end + url = identifier + end [name, url] end