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