fix competition list filter

dev_aliyun
p31729568 5 years ago
parent ebe1681f40
commit c28128ada8

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

Loading…
Cancel
Save