From c891a41ef108839103a3ce7833f3b87e0c49d864 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 9 Aug 2016 15:23:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 2 ++ app/services/courses_service.rb | 2 ++ app/services/syllabuses_service.rb | 3 +++ 3 files changed, 7 insertions(+) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index dcbd1f38b..e6d913ffd 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -62,6 +62,7 @@ class AdminController < ApplicationController course = Course.where("id = #{params[:course_id].to_i}").first unless course.nil? course.update_column('syllabus_id', params[:syllabus_id].to_i) + logger.error "update_syllabus_id: admin_controller/select_scourse_syllabus" @flag = true end end @@ -83,6 +84,7 @@ class AdminController < ApplicationController syllabus.description = Message.where("id = 19412").first.nil? ? nil : Message.where("id = 19412").first.content if syllabus.save course.update_column('syllabus_id', syllabus.id) + logger.error "update_syllabus_id: admin_controller/create_syllabus" @flag = params[:flag].to_i @course = course respond_to do |format| diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index ce3157d5f..d01b89833 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -218,6 +218,7 @@ class CoursesService #@course.password = params[:course][:password] @course.tea_id = current_user.id @course.syllabus_id = params[:syllabus_id].to_i + logger.error "update_syllabus_id: courses_service/create_course" @course.term = params[:term] @course.time = params[:time] @course.end_term = params[:end_term] @@ -277,6 +278,7 @@ class CoursesService #course.safe_attributes = params[:course] #course.password = params[:course][:password] course.syllabus_id = params[:syllabus_id].to_i + logger.error "update_syllabus_id: courses_service/edit_course" course.time = params[:time] course.term = params[:term] course.end_time = params[:end_time] diff --git a/app/services/syllabuses_service.rb b/app/services/syllabuses_service.rb index fcb70653b..8911032dd 100644 --- a/app/services/syllabuses_service.rb +++ b/app/services/syllabuses_service.rb @@ -86,12 +86,14 @@ class SyllabusesService courses.each do |course| if ::Course === course course.syllabus_id = sy.id + logger.error "update_syllabus_id: syllabus_service/create" course.save! send_wechat_create_class_notice user,course elsif Hash === course c = ::Course.new(course) c.tea_id = user.id c.syllabus_id = sy.id + logger.error "update_syllabus_id: syllabus_service/create" c.update_default_value c.is_public = 0 c.save! @@ -136,6 +138,7 @@ class SyllabusesService course.name = c course.tea_id = user.id course.syllabus_id = sy.id + logger.error "update_syllabus_id: syllabus_service/edit" course.update_default_value course.is_public = 0 course.save!