|
|
|
@ -62,13 +62,13 @@ class CoursesController < ApplicationController
|
|
|
|
|
if @order == "mine"
|
|
|
|
|
tip_exception(401, "..") unless current_user.logged?
|
|
|
|
|
@courses = Course.joins(:course_members)
|
|
|
|
|
.where("is_delete = 0 AND is_hidden = 0 AND course_members.user_id = ?", @user.id)
|
|
|
|
|
.where("is_delete = 0 AND is_hidden = 0 AND course_members.user_id = ?", @user.id).distinct
|
|
|
|
|
elsif @order == "created_at"
|
|
|
|
|
# REDO:Extension
|
|
|
|
|
@courses = Course.where(is_delete: 0, is_hidden: 0, is_end: 0)
|
|
|
|
|
@courses = Course.where(is_delete: 0, is_hidden: 0, is_end: 0).distinct
|
|
|
|
|
else
|
|
|
|
|
# REDO:Extension
|
|
|
|
|
@courses = Course.where(is_delete: 0, is_hidden: 0)
|
|
|
|
|
@courses = Course.where(is_delete: 0, is_hidden: 0).distinct
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 根据搜索关键字进一步筛选
|
|
|
|
|