From 3a8395f906984ea6ee39633f2db4982d3d03fbaa Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 28 Feb 2020 02:51:08 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/tfxy.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/tfxy.rake b/lib/tasks/tfxy.rake index 89e5e4367..433f39c86 100644 --- a/lib/tasks/tfxy.rake +++ b/lib/tasks/tfxy.rake @@ -157,7 +157,7 @@ namespace :tfxy do 2.upto(student_data_last_row) do |r| # 邮箱存在 - if student_data.cell(r, 9).strip.present? + if student_data.cell(r, 9)&.strip.present? old_user = User.where("phone = '#{student_data.cell(r, 8)}' OR mail = '#{student_data.cell(r, 9).strip}' OR login = 'tfxy#{student_data.cell(r, 1)}' " ).first else old_user = User.where("phone = '#{student_data.cell(r, 8)}' OR login = 'tfxy#{student_data.cell(r, 1)}' " ).first From 49277a9f29bb7c1e4d86f84f84a13ff190ff255f Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 28 Feb 2020 02:54:20 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E9=82=AE=E7=AE=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/tfxy.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/tfxy.rake b/lib/tasks/tfxy.rake index 433f39c86..9ecc403c8 100644 --- a/lib/tasks/tfxy.rake +++ b/lib/tasks/tfxy.rake @@ -172,7 +172,7 @@ namespace :tfxy do lastname: student_data.cell(r, 2), nickname: student_data.cell(r, 2), password: "Edu#{student_data.cell(r, 1)}", - mail: student_data.cell(r, 9).strip, + mail: student_data.cell(r, 9)&.strip.present? ? student_data.cell(r, 9)&.strip : nil, profile_completed: true, professional_certification: 1, certification: 1, From 2ca9f0e7198343edca533c71af9194fea6109da9 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 28 Feb 2020 02:57:38 +0800 Subject: [PATCH 3/8] 1 --- lib/tasks/tfxy.rake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/tfxy.rake b/lib/tasks/tfxy.rake index 9ecc403c8..42c04c0c5 100644 --- a/lib/tasks/tfxy.rake +++ b/lib/tasks/tfxy.rake @@ -157,8 +157,8 @@ namespace :tfxy do 2.upto(student_data_last_row) do |r| # 邮箱存在 - if student_data.cell(r, 9)&.strip.present? - old_user = User.where("phone = '#{student_data.cell(r, 8)}' OR mail = '#{student_data.cell(r, 9).strip}' OR login = 'tfxy#{student_data.cell(r, 1)}' " ).first + if student_data.cell(r, 9).to_s&.strip.present? + old_user = User.where("phone = '#{student_data.cell(r, 8)}' OR mail = '#{student_data.cell(r, 9).to_s.strip}' OR login = 'tfxy#{student_data.cell(r, 1)}' " ).first else old_user = User.where("phone = '#{student_data.cell(r, 8)}' OR login = 'tfxy#{student_data.cell(r, 1)}' " ).first end @@ -172,7 +172,7 @@ namespace :tfxy do lastname: student_data.cell(r, 2), nickname: student_data.cell(r, 2), password: "Edu#{student_data.cell(r, 1)}", - mail: student_data.cell(r, 9)&.strip.present? ? student_data.cell(r, 9)&.strip : nil, + mail: student_data.cell(r, 9).to_s&.strip.present? ? student_data.cell(r, 9).to_s&.strip : nil, profile_completed: true, professional_certification: 1, certification: 1, From eb373f10d68dcf8ad52ecdeb4600ffb885ec8e45 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 28 Feb 2020 03:38:05 +0800 Subject: [PATCH 4/8] 1 --- app/models/user.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/user.rb b/app/models/user.rb index 5c22f46e7..b3a1da84d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -655,6 +655,7 @@ class User < ApplicationRecord # 邮箱:w***l@qq.com def hidden_mail + Rails.logger.info("######-----: #{mail}") Util.conceal(mail, :email).to_s end From e888de0c6a68c1642410376e1a63c16ba7e47631 Mon Sep 17 00:00:00 2001 From: anke1460 Date: Fri, 28 Feb 2020 04:26:05 +0800 Subject: [PATCH 5/8] fix --- lib/tasks/tfxy.rake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/tasks/tfxy.rake b/lib/tasks/tfxy.rake index 7a4ee08e3..40026c6bc 100644 --- a/lib/tasks/tfxy.rake +++ b/lib/tasks/tfxy.rake @@ -18,7 +18,12 @@ namespace :tfxy do teach_data_last_row = teach_data.last_row 2.upto(teach_data_last_row) do |r| - old_user = User.where("phone = '#{teach_data.cell(r, 5)}' OR mail = '#{teach_data.cell(r, 6)}' OR login = 'tfxy#{teach_data.cell(r, 1)}' " ).first + + if teach_data.cell(r, 6).to_s&.strip.present? + old_user = User.where("phone = '#{teach_data.cell(r, 5)}' OR mail = '#{teach_data.cell(r, 6).to_s.strip}' OR login = 'tfxy#{teach_data.cell(r, 1)}' " ).first + else + old_user = User.where("phone = '#{teach_data.cell(r, 5)}' OR login = 'tfxy#{teach_data.cell(r, 1)}' ").first + end if !old_user.present? user = User.new( @@ -29,7 +34,7 @@ namespace :tfxy do lastname: teach_data.cell(r, 2), nickname: teach_data.cell(r, 2), password: "Edu#{teach_data.cell(r, 5)}", - mail: teach_data.cell(r, 6), + mail: teach_data.cell(r, 6).to_s&.strip.present? ? teach_data.cell(r, 6).to_s&.strip : nil, profile_completed: true, professional_certification: 1, certification: 1, From dd02cae28055a2cd1a4360dce4e23ed199029e87 Mon Sep 17 00:00:00 2001 From: anke1460 Date: Fri, 28 Feb 2020 04:58:37 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E7=99=BB=E5=BD=95=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/tfxy.rake | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/tasks/tfxy.rake b/lib/tasks/tfxy.rake index 40026c6bc..f1644e320 100644 --- a/lib/tasks/tfxy.rake +++ b/lib/tasks/tfxy.rake @@ -210,13 +210,12 @@ namespace :tfxy do else # 系统已有用户,关联sso认证用户 old_user.update( - login: "tfxy#{student_data.cell(r, 1)}", - lastname: student_data.cell(r, 2), - nickname: student_data.cell(r, 2), - certification: true, - professional_certification: true, - authentication: true, - profile_completed: true) + lastname: student_data.cell(r, 2), + nickname: student_data.cell(r, 2), + certification: true, + professional_certification: true, + authentication: true, + profile_completed: true) OpenUsers::Cas.find_or_create_by(uid: student_data.cell(r, 1)) do |u| u.extra = {phone: student_data.cell(r, 8)} From 26070cd8f70828c13704b7286a955942f73e6209 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 28 Feb 2020 05:28:49 +0800 Subject: [PATCH 7/8] 1 --- app/views/homework_commons/index.json.jbuilder | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/homework_commons/index.json.jbuilder b/app/views/homework_commons/index.json.jbuilder index 44eabe06d..23d700beb 100644 --- a/app/views/homework_commons/index.json.jbuilder +++ b/app/views/homework_commons/index.json.jbuilder @@ -24,9 +24,9 @@ json.homeworks @homework_commons.each do |homework| # 只有在主目录才显示 json.upper_category_name homework.course_second_category&.name unless params[:category] - charge_ids = @course.charge_group_ids(@member) - json.publish_immediately @user_course_identity < Course::STUDENT && homework.publish_immediately(charge_ids) - json.end_immediately @user_course_identity < Course::STUDENT && homework.end_immediately(charge_ids) + # charge_ids = @course.charge_group_ids(@member) + # json.publish_immediately @user_course_identity < Course::STUDENT && homework.publish_immediately(charge_ids) + # json.end_immediately @user_course_identity < Course::STUDENT && homework.end_immediately(charge_ids) unless curr_status[:status].include?("未发布") work_count = calculate_work_count homework, @member From 6d552378e38f82ededf1d60fe5b918c59d293906 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 28 Feb 2020 10:50:50 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E5=9B=9E=E8=B0=83=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/videos/dispatch_callback_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/videos/dispatch_callback_service.rb b/app/services/videos/dispatch_callback_service.rb index e6c089ac2..b32c87c4e 100644 --- a/app/services/videos/dispatch_callback_service.rb +++ b/app/services/videos/dispatch_callback_service.rb @@ -3,7 +3,7 @@ class Videos::DispatchCallbackService < ApplicationService def initialize(params) @video = Video.find_by(uuid: params[:VideoId]) - @params = params`` + @params = params end def call