Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

schedule_job
杨树明 5 years ago
commit fc0058fb52

@ -1306,7 +1306,7 @@ class CoursesController < ApplicationController
@user = current_user @user = current_user
@switch_student = Course::BUSINESS < @user_course_identity && @user_course_identity < Course::STUDENT @switch_student = Course::BUSINESS < @user_course_identity && @user_course_identity < Course::STUDENT
@is_student = @user_course_identity == Course::STUDENT @is_student = @user_course_identity == Course::STUDENT
@teacher_users = @course.teacher_users.where.not(id: @course.tea_id).map(&:real_name)[0..2] @teacher_users = @course.teacher_users.where.not(id: @course.tea_id).map(&:real_name)[0..3]
@course.increment!(:visits) @course.increment!(:visits)
end end

@ -76,7 +76,7 @@ class Weapps::CoursesController < Weapps::BaseController
def show def show
@course = current_course @course = current_course
@current_user = current_user @current_user = current_user
@teacher_users = @course.teacher_users.where.not(id: @course.tea_id).map(&:real_name)[0..2] @teacher_users = @course.teacher_users.where.not(id: @course.tea_id).map(&:real_name)[0..3]
end end
def shixun_homework_category def shixun_homework_category

@ -13,7 +13,7 @@ json.courses @courses do |course|
json.is_end course.is_end json.is_end course.is_end
json.first_category_url module_url(course.none_hidden_course_modules.first, course) json.first_category_url module_url(course.none_hidden_course_modules.first, course)
json.excellent course.excellent json.excellent course.excellent
json.teacher_users course.teacher_users.select{|u| u.id != course.tea_id }.map(&:real_name)[0..2] # 取前3名老师 json.teacher_users course.teacher_users.select{|u| u.id != course.tea_id }.map(&:real_name)[0..3] # 取前4名老师
end end
json.courses_count @courses_count json.courses_count @courses_count

@ -7,7 +7,7 @@ json.homework_commons_count get_tasks_count course
json.attachments_count course.attachments.count json.attachments_count course.attachments.count
json.visits course.visits json.visits course.visits
json.school course.school&.name json.school course.school&.name
json.teacher_users course.teacher_users.select{|u| u.id != course.tea_id }.map(&:real_name)[0..2] # 取前3名老师 json.teacher_users course.teacher_users.select{|u| u.id != course.tea_id }.map(&:real_name)[0..3] # 取前4名老师
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)

@ -26,6 +26,6 @@ json.courses @courses.each do |course|
course_member = @category == "study" ? course.students.where(user_id: @user.id).first : course.teachers.where(user_id: @user.id).first course_member = @category == "study" ? course.students.where(user_id: @user.id).first : course.teachers.where(user_id: @user.id).first
json.sticky course_member.sticky json.sticky course_member.sticky
json.course_identity current_user.course_identity(course) json.course_identity current_user.course_identity(course)
json.teacher_users course.teacher_users.select{|u| u.id != course.tea_id }.map(&:real_name)[0..2] # 取前3名老师 json.teacher_users course.teacher_users.select{|u| u.id != course.tea_id }.map(&:real_name)[0..3] # 取前4名老师
end end

Loading…
Cancel
Save