From 605285162440a4e9e1faaf8aa43d336fb3eeb32b Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 4 Feb 2020 15:13:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=95=B0=E6=8D=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/weapps/subjects/index.json.jbuilder | 1 + app/views/weapps/subjects/show.json.jbuilder | 1 + 2 files changed, 2 insertions(+) diff --git a/app/views/weapps/subjects/index.json.jbuilder b/app/views/weapps/subjects/index.json.jbuilder index cfdce4530..fd12827b0 100644 --- a/app/views/weapps/subjects/index.json.jbuilder +++ b/app/views/weapps/subjects/index.json.jbuilder @@ -1,6 +1,7 @@ json.subjects @subjects do |subject| json.(subject, :id, :excellent, :name, :stages_count, :shixuns_count) json.myshixuns_count subject.member_count + json.challenges_count subject.subject_challenge_count json.image_url url_to_avatar(subject) json.allow_visit subject.status > 1 || User.current.manager_of_subject?(subject) || User.current.admin? end diff --git a/app/views/weapps/subjects/show.json.jbuilder b/app/views/weapps/subjects/show.json.jbuilder index 757257e82..29a30a89a 100644 --- a/app/views/weapps/subjects/show.json.jbuilder +++ b/app/views/weapps/subjects/show.json.jbuilder @@ -2,6 +2,7 @@ json.subject do json.name @subject.name json.description @subject.description json.shixuns_count @subject.shixuns_count + json.challenges_count @subject.subject_challenge_count json.member_count @subject.member_count json.subject_score @subject.all_score json.learning_notes @subject.learning_notes