issue修复

dev_forum
SylorHuang 5 years ago
parent 0719eea4ec
commit 2719cf29f3

@ -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
# 根据搜索关键字进一步筛选 # 根据搜索关键字进一步筛选

@ -156,7 +156,7 @@ class GraduationTasksController < ApplicationController
} }
end end
else else
normal_status(status == -2 ? "500M" : "无附件可下载") normal_status(status,status == -2 ? "500M" : "无附件可下载")
end end
end end
end end

@ -228,7 +228,7 @@ class HomeworkCommonsController < ApplicationController
} }
end end
else else
normal_status(status == -2 ? "500M" : "无附件可下载") normal_status(status, status == -2 ? "500M" : "无附件可下载")
end end
end end
end end

@ -1,7 +1,9 @@
json.id course.id json.id course.id
json.name course.name json.name course.name
json.members_count course.members_count # json.members_count course.members_count
json.homework_commons_count course.homework_commons_count json.members_count course.course_members_count
# json.homework_commons_count course.homework_commons_count
json.homework_commons_count get_tasks_count course
json.attachments_count course.attachments.count json.attachments_count course.attachments.count
json.first_category_url module_url(course.course_modules.where(hidden: 0).order(position: :desc).first, course) json.first_category_url module_url(course.course_modules.where(hidden: 0).order(position: :desc).first, course)

Loading…
Cancel
Save