|
|
@ -47,6 +47,7 @@ class HomeworkCommon < ApplicationRecord
|
|
|
|
scope :homework_published, -> {where("homework_commons.publish_time IS NOT NULL AND homework_commons.publish_time <= ? ",Time.now)}
|
|
|
|
scope :homework_published, -> {where("homework_commons.publish_time IS NOT NULL AND homework_commons.publish_time <= ? ",Time.now)}
|
|
|
|
scope :published_no_end, -> {where("homework_commons.publish_time IS NOT NULL AND homework_commons.publish_time < ?
|
|
|
|
scope :published_no_end, -> {where("homework_commons.publish_time IS NOT NULL AND homework_commons.publish_time < ?
|
|
|
|
and homework_commons.end_time > ?", Time.now, Time.now)}
|
|
|
|
and homework_commons.end_time > ?", Time.now, Time.now)}
|
|
|
|
|
|
|
|
scope :homework_ended, -> {where("homework_commons.end_time IS NOT NULL AND homework_commons.end_time <= ? ",Time.now)}
|
|
|
|
scope :search_homework_type, lambda {|num| where(homework_type:num)}
|
|
|
|
scope :search_homework_type, lambda {|num| where(homework_type:num)}
|
|
|
|
scope :unified_setting, -> {where("unified_setting = ? ", 1)}
|
|
|
|
scope :unified_setting, -> {where("unified_setting = ? ", 1)}
|
|
|
|
|
|
|
|
|
|
|
|