This commit is contained in:
parent
c02aa7a0e3
commit
01fd32fdd6
|
@ -46,13 +46,13 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
# 正在进行中任务
|
# 正在进行中任务
|
||||||
def shixun_running shixun
|
def shixun_running shixun, position
|
||||||
Myshixun.where(:parent_id => shixun, :status => 0).count
|
Myshixun.find_by_sql("SELECT * FROM `myshixuns` ms, `games` g where g.myshixun_id = ms.id and parent_id =#{shixun.id} and g.stage=#{position} and (g.status=0 or g.status=1);").count
|
||||||
end
|
end
|
||||||
|
|
||||||
# 已完成任务
|
# 已完成任务
|
||||||
def shixun_done shixun
|
def shixun_done shixun, position
|
||||||
Myshixun.where(:parent_id => shixun, :status => 1).count
|
Myshixun.find_by_sql("SELECT * FROM `myshixuns` ms, `games` g where g.myshixun_id = ms.id and parent_id =#{shixun.id} and g.stage=#{position} and g.status=2;").count
|
||||||
end
|
end
|
||||||
|
|
||||||
# 测评次数
|
# 测评次数
|
||||||
|
|
|
@ -27,11 +27,11 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<p class="ml15 mt15 color-grey">
|
<p class="ml15 mt15 color-grey">
|
||||||
<% if shixun_running(@shixun) != 0 %>
|
<% if shixun_running(@shixun, challenge.position) != 0 %>
|
||||||
<span class=" mr10">正在挑战:<%= shixun_running @shixun %></span>
|
<span class=" mr10">正在挑战:<%= shixun_running(@shixun, challenge.position) %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if shixun_done(@shixun) != 0 %>
|
<% if shixun_done(@shixun, challenge.position) != 0 %>
|
||||||
<span class=" mr10">完成挑战:<%= shixun_done @shixun %></span>
|
<span class=" mr10">完成挑战:<%= shixun_done(@shixun, challenge.position) %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if top_score(@shixun, challenge.position).score.to_i != 0 %>
|
<% if top_score(@shixun, challenge.position).score.to_i != 0 %>
|
||||||
<span class=" mr10">最佳表现:<%= top_score(@shixun, challenge.position).score.to_i %>分</span>
|
<span class=" mr10">最佳表现:<%= top_score(@shixun, challenge.position).score.to_i %>分</span>
|
||||||
|
|
Loading…
Reference in New Issue