From b3c91e54db06015842aa0403be0fabe342338619 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 2 Aug 2019 14:30:30 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dump.rdb | Bin 668 -> 764 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/dump.rdb b/dump.rdb index 4687968bdc78f7e61538606ad77386166339f236..63b8abb0ac1774c1ce21048cfe8c89e5356d4737 100644 GIT binary patch delta 347 zcmWN^JugF17y#gVdRwhZ2U8=_v~CQD!}+}ToNkve*hIu6oO{k&A=-+5EC{h$(8R>x z7ud{L{0*s&egV?(Y|nk>H*-zKZ=aX9zjK`yI9!MN+l#x2=Sg$5P%eykUOw%4zURe1 zCxJaQtyWMCV%y&D!df#aR;%kB=s@hu(apo&G>sT_ARVR}3>H8fHY_sOS?;VgiO-ns z&7iyU-LInMN=rkuOt>~8)WiUlM7YY;q&)`H2Df9{L6yo-L{u^^7KG$VMU{rvFx`)_ za#o8_oehVm|Ab1Q5>B)WF-Xp_Fj`^7O${?!OSGGsMXc6;MMbDZ#t6}SN8_b_0gX}~ zEeIYGM*nwF_BGQaKq!^!jiu%m2P^)_MkhG{+pcVRbO7nRpg;s;3K*Hr=M+nnkdbgp UpMz|==TanhaJqCkF}3;l2M<1EBme*a delta 237 zcmVMLtXj^b#rB8Ep26O!oXsYK`by2L<|OVRLgLIwC=1bZK^FN^fF1I#G3Hb!9tQooAB|0v-lpGXps?W|JrZmQ8@{ z7G^hLVKg*3WHU7}Vqr68H)T0uGc+<`Ad4Jha%Ew3Wn^DrbRs%2H8wOiF*PwWH!d_Y zHZU?VAZ`F|VRqmO9|$=zIWRbV{{8`zYXT}S;za=lQ*~l$Wn*+8R{$~MWdas7F=a3` nGBP-2GB9B Date: Fri, 2 Aug 2019 17:12:32 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/graduation_topics/_graduation_comments.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/graduation_topics/_graduation_comments.json.jbuilder b/app/views/graduation_topics/_graduation_comments.json.jbuilder index ee9ed7529..51551d95d 100644 --- a/app/views/graduation_topics/_graduation_comments.json.jbuilder +++ b/app/views/graduation_topics/_graduation_comments.json.jbuilder @@ -11,6 +11,6 @@ if message.m_parent_id json.can_delete message.can_delete(identity) else json.praise_count message.praise_treads.select{|pt| pt.praise_or_tread == 1}.count - json.user_praise message.praise_treads.select{|pt| pt.praise_or_tread == 1 && user_id == current_user.id}.count + json.user_praise message.praise_treads.select{|pt| pt.praise_or_tread == 1 && pt.user_id == current_user.id}.count json.child_message_count message.m_reply_count end From 7d34d8ea3cb8083ab315f28b828e597d82ec1d5b Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 2 Aug 2019 17:35:25 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=AF=BE=E5=A0=82?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 8 +++++--- app/models/user.rb | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 9f62a03bb..6c2eb5299 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -928,12 +928,14 @@ class CoursesController < ApplicationController course_message.save! - role = course_message.content == 2 ? '7' : '9' # 7:助教 9:教师 + role = course_message.content == 2 ? '9' : '7' # 7:助教 9:教师 ApplyTeacherRoleJoinCourseNotifyJob.perform_later(current_user.id, course.id, role) - message = "#{course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" + message = "#{course_message.content == 2 ? '教师' : '助教'}申请已提交,请等待审核" else - message = "#{existing_course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" + message = "#{existing_course_message.content == 2 ? '教师' : '助教'}申请已提交,请等待审核" end + else + message = "您已是课堂成员" end teacher_role = 1 end diff --git a/app/models/user.rb b/app/models/user.rb index b453f9998..e9d6ce54b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -234,7 +234,7 @@ class User < ApplicationRecord # 课堂的老师(创建者、老师、助教),不用考虑当前身份 def teacher_of_course_non_active?(course) - course.course_members.exists?(user_id: id, role: [1,2,3]) || admin? || business? + course.course_members.exists?(user_id: id, role: [1,2,3]) end # 是否是教师,课堂管理员或者超级管理员