Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_forum
daiao 5 years ago
commit 364573a2ed

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

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

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

@ -1,7 +1,9 @@
json.id course.id
json.name course.name
json.members_count course.members_count
json.homework_commons_count course.homework_commons_count
# json.members_count course.members_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.first_category_url module_url(course.course_modules.where(hidden: 0).order(position: :desc).first, course)

Loading…
Cancel
Save