From 10a72d7ae957799cfe0136312bfe2b365514db8c Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 25 Jul 2019 18:33:17 +0800 Subject: [PATCH 1/2] =?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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index b40321dd3..778d40b81 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -928,6 +928,8 @@ class CoursesController < ApplicationController ApplyTeacherRoleJoinCourseNotifyJob.perform_later(current_user.id, course.id, role) teacher_role = 1 message = "#{course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" + else + message = "#{existing_course_message.extra.to_i == 7 ? '助教' : '教师'}申请已提交,请等待审核" end end end From a807df07ed8cbb80409bda1505964fbd7d3f8952 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 25 Jul 2019 18:35:55 +0800 Subject: [PATCH 2/2] =?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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 778d40b81..faad02173 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -914,7 +914,7 @@ class CoursesController < ApplicationController teacher_already_exist = current_user.teacher_of_course_non_active? course unless teacher_already_exist existing_course_message = CourseMessage.find_by(course_id: course.id, course_message_id: current_user.id, - course_message_type: "JoinCourseRequest", status: 0, viewed: false) + course_message_type: "JoinCourseRequest", status: 0) if existing_course_message.blank? course_message = CourseMessage.new(course_id: course.id, user_id: course.tea_id, status: 0, course_message_id: current_user.id, course_message_type: "JoinCourseRequest", @@ -929,7 +929,7 @@ class CoursesController < ApplicationController teacher_role = 1 message = "#{course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" else - message = "#{existing_course_message.extra.to_i == 7 ? '助教' : '教师'}申请已提交,请等待审核" + message = "#{existing_course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" end end end @@ -943,7 +943,7 @@ class CoursesController < ApplicationController end rescue => e uid_logger(e.message) - tip_exception("加入课堂失败") + tip_exception(e.message) raise ActiveRecord::Rollback end end