From bb80e8bdb9c048871e62f05b3535851bb9833400 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 20 Mar 2020 23:43:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8F=E5=8A=A9=E8=80=81=E5=B8=88=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=95=B0=E6=8D=AE=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- app/controllers/weapps/courses_controller.rb | 2 +- app/views/courses/index.json.jbuilder | 2 +- app/views/users/courses/shared/_course.json.jbuilder | 2 +- app/views/weapps/homes/show.json.jbuilder | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 46bb3fe06..c514bc0ff 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1306,7 +1306,7 @@ class CoursesController < ApplicationController @user = current_user @switch_student = Course::BUSINESS < @user_course_identity && @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) end diff --git a/app/controllers/weapps/courses_controller.rb b/app/controllers/weapps/courses_controller.rb index 3a1b22cc4..d9bfacdfe 100644 --- a/app/controllers/weapps/courses_controller.rb +++ b/app/controllers/weapps/courses_controller.rb @@ -76,7 +76,7 @@ class Weapps::CoursesController < Weapps::BaseController def show @course = current_course @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 def shixun_homework_category diff --git a/app/views/courses/index.json.jbuilder b/app/views/courses/index.json.jbuilder index b1c095ff1..bcea4d0a2 100644 --- a/app/views/courses/index.json.jbuilder +++ b/app/views/courses/index.json.jbuilder @@ -13,7 +13,7 @@ json.courses @courses do |course| json.is_end course.is_end json.first_category_url module_url(course.none_hidden_course_modules.first, course) 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 json.courses_count @courses_count diff --git a/app/views/users/courses/shared/_course.json.jbuilder b/app/views/users/courses/shared/_course.json.jbuilder index d3de455a8..98ad3ea7e 100644 --- a/app/views/users/courses/shared/_course.json.jbuilder +++ b/app/views/users/courses/shared/_course.json.jbuilder @@ -7,7 +7,7 @@ json.homework_commons_count get_tasks_count course json.attachments_count course.attachments.count json.visits course.visits 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) diff --git a/app/views/weapps/homes/show.json.jbuilder b/app/views/weapps/homes/show.json.jbuilder index 5d0e35e05..c4f54ab46 100644 --- a/app/views/weapps/homes/show.json.jbuilder +++ b/app/views/weapps/homes/show.json.jbuilder @@ -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 json.sticky course_member.sticky 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