fix competition list filter

dev_aliyun
p31729568 6 years ago
parent ebe1681f40
commit c28128ada8

@ -29,9 +29,9 @@ class CompetitionsController < ApplicationController
case params[:category] case params[:category]
when 'nearly_published' then when 'nearly_published' then
competitions = competitions.where('published_at is not null AND status = 0') competitions = competitions.where('status = 0')
when 'progressing' then when 'progressing' then
competitions = competitions.where('end_time > NOW()') competitions = competitions.where('end_time > NOW() AND status = 1')
when 'ended' then when 'ended' then
competitions = competitions.where('end_time < NOW()') competitions = competitions.where('end_time < NOW()')
end end

Loading…
Cancel
Save