个人主页课堂过滤掉开放课堂

dev_cs
cxt 5 years ago
parent d3886a366c
commit 151c7645f4

@ -82,6 +82,7 @@ class Course < ApplicationRecord
scope :ended, ->(is_end = true) { where(is_end: is_end) }
scope :processing, -> { where(is_end: false) }
scope :not_deleted, -> { where(is_delete: 0) }
scope :not_excellent, -> { where(excellent: 0) }
scope :deleted, ->(is_delete = 1) { where(is_delete: is_delete) }
scope :by_user, ->(user) { joins(:course_members).where('course_members.user_id = ?', user.id).order(updated_at: :desc) }
scope :by_keywords, lambda { |keywords|

@ -11,7 +11,7 @@ class Users::CourseService
end
def call
courses = category_scope_courses.not_deleted
courses = category_scope_courses.not_deleted.not_excellent
courses = status_filter(courses)

Loading…
Cancel
Save