竞赛的状态过滤

dev_sync_trustie
cxt 5 years ago
parent 81dd91f857
commit 75924a5130

@ -13,7 +13,7 @@ class Competitions::CompetitionsController < Competitions::BaseController
competitions =
case params[:category]
when 'nearly_published' then competitions.where(status: false)
when 'progressing' then competitions.where('status = 0 and end_time > NOW()')
when 'progressing' then competitions.where('status = 1 and end_time > NOW()')
when 'ended' then competitions.where('end_time < NOW()')
else competitions
end

Loading…
Cancel
Save