From 8636f2d2e85e61dbb694427483dad4647e8ac4db Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 7 Feb 2020 13:12:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E9=80=89=E7=94=A8=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/subjects/choose_course.json.jbuilder | 9 +++++++-- app/views/weapps/shixun_lists/index.json.jbuilder | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/subjects/choose_course.json.jbuilder b/app/views/subjects/choose_course.json.jbuilder index f5e33d4ee..252359710 100644 --- a/app/views/subjects/choose_course.json.jbuilder +++ b/app/views/subjects/choose_course.json.jbuilder @@ -4,12 +4,17 @@ json.courses @courses do |course| json.created_at course.created_at end -json.stages @subject.stages do |stage| +json.stages @subject.stages.includes(shixuns: [user: :user_extension]) do |stage| index = 1 json.shixuns stage.shixuns do |shixun| - if shixun.status == 2 && !@none_shixun_ids.include?(shixun.id) + if shixun.status == 2 && !shixun.is_jupyter && !@none_shixun_ids.include?(shixun.id) json.shixun_id shixun.id json.shixun_name "#{stage.position}-#{index} #{shixun.name}" + json.title shixun.name + json.level level_to_s(shixun.trainee) + json.study_count shixun.myshixuns_count + json.author_name shixun.user.real_name + json.author_img url_to_avatar(shixun.user) end index += 1 end diff --git a/app/views/weapps/shixun_lists/index.json.jbuilder b/app/views/weapps/shixun_lists/index.json.jbuilder index c83baa6aa..fac238f45 100644 --- a/app/views/weapps/shixun_lists/index.json.jbuilder +++ b/app/views/weapps/shixun_lists/index.json.jbuilder @@ -4,7 +4,6 @@ json.shixun_list @results do |obj| json.level level_to_s(obj.trainee) json.study_count obj.myshixuns_count json.author_name obj.user.real_name - json.author_school_name obj.user.school_name json.author_img url_to_avatar(obj.user) end json.shixuns_count @total_count \ No newline at end of file