dev_auth
cxt 5 years ago
parent 2b14956dee
commit 91eecc3ffe

@ -38,8 +38,10 @@ module CompetitionsHelper
def chart_stages competition
stages = []
statistic_stages = competition.competition_stages.where("score_rate > 0")
if competition.max_stage_end_time && competition.max_stage_end_time < Time.now && statistic_stages.size > 1
stages << {id: nil, name: "总排行榜", rate: 1.0, start_time: competition.start_time, end_time: competition.end_time}
end_time = competition.max_stage_end_time || competition.end_time
if end_time && end_time < Time.now
stages << {id: nil, name: statistic_stages.size > 1 ? "总排行榜" : "排行榜", rate: 1.0, start_time: competition.start_time, end_time: competition.end_time}
end
statistic_stages.each do |stage|

@ -21,7 +21,7 @@ class Admins::CompetitionNavSettingService < ApplicationService
else
com_module = CompetitionModule.create!(competition_id: competition.id, module_type: 'md')
end
com_module.update_attributes!(hidden: nav["hidden"] ? 0 : 1, position: nav["position"] ? nav["position"] : com_module.position, name: nav["name"], url: nav["url"])
com_module.update_attributes!(hidden: nav["hidden"] ? 0 : 1, position: nav["position"] ? nav["position"] : com_module.length + 1, name: nav["name"], url: nav["url"])
end
delete_module_ids = old_module_ids - module_ids

@ -325,7 +325,7 @@
</div>
<% if @competition.mode == 1 %>
<%# if @competition.mode == 1 %>
<div class="card mb-5 competition-chart-stages">
<div class="card-header d-flex justify-content-between align-items-center">
<span>排行榜设置</span>
@ -493,4 +493,4 @@
</div>
</div>
<div style="margin-bottom: 8.5rem;"></div>
<% end %>
<%# end %>
Loading…
Cancel
Save