From 1cdc0bdfd6ec480f9e0130c1eb8d9df347a79146 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Tue, 4 Jun 2019 09:49:40 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E5=AD=A6=E6=A0=A1=E7=BB=9F=E8=AE=A1?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=AD=97=E9=9D=A2=E6=9B=B4=E6=94=B9=EF=BC=9A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/colleges/statistics.html.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/colleges/statistics.html.erb b/app/views/colleges/statistics.html.erb
index 0a159d2a..98c5be73 100644
--- a/app/views/colleges/statistics.html.erb
+++ b/app/views/colleges/statistics.html.erb
@@ -19,7 +19,7 @@
<%= @courses_count %>
-
- { item.hidden && comment.admin === false && comment.manager === false
+ {/* 改成后端返回了的,都是要显示的,不管hidden的值是true还是false */}
+ {/* { item.hidden && comment.admin === false && comment.manager === false
?
违规评论已被屏蔽!
- :
- }
+ : */}
+
+ {/* } */}
@@ -309,10 +310,12 @@ class Comments extends Component {
- { item.hidden && item.admin === false && (item.manager === false || item.manager == undefined)
+ {/* 改成后端返回了的,都是要显示的,不管hidden的值是true还是false */}
+ {/* { item.hidden && item.admin === false && (item.manager === false || item.manager == undefined)
?
违规评论已被屏蔽!
- :
- }
+ : */}
+
+ {/* } */}
From 7d34217b9e38218c017622b16d2584e7a983b98a Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Wed, 5 Jun 2019 15:17:24 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=B3=A8=E5=86=8C?=
=?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E5=A6=82=E6=9E=9C=E9=80=89?=
=?UTF-8?q?=E7=94=A8=E7=9A=84=E6=98=AF=E8=80=81=E5=B8=88=E8=BA=AB=E4=BB=BD?=
=?UTF-8?q?=EF=BC=8C=E5=88=99=E7=BB=99=E9=9B=85=E8=8F=B2=E6=89=8B=E6=9C=BA?=
=?UTF-8?q?=E5=8F=91=E9=80=81=E4=B8=80=E6=9D=A1=E7=9F=AD=E4=BF=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/account_controller.rb | 9 ++++++++-
lib/trustie/sms/sms.rb | 2 ++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb
index 60096a22..128475e6 100644
--- a/app/controllers/account_controller.rb
+++ b/app/controllers/account_controller.rb
@@ -456,7 +456,9 @@ class AccountController < ApplicationController
@pref = @user.pref
@se = @user.extensions
- # 已授权的用户修改单位名称,需要重新授权
+ old_identity = @se.identity
+
+ # 已授权的用户修改单位名称,需要重新授权
if @se.school_id != params[:occupation].to_i && @user.certification == 1
@user.certification = 0
apply_user = ApplyAction.where(:user_id => @user.id, :container_type => "TrialAuthorization")
@@ -510,10 +512,15 @@ class AccountController < ApplicationController
@se.technical_title = params[:pro_technical_title] if params[:pro_technical_title]
@se.student_id = nil
end
+
# @se.brief_introduction = params[:brief_introduction]
if @user.save && @se.save
+ if old_identity.nil? && @se.identity == 0
+ Trustie::Sms.send(mobile: '17680641960', send_type:'teacher_register', name: @user.login, user_name: "管理员")
+ end
+
reward_grade(@user, @user.id, 'Account', 500)
if @user.certification != 1
diff --git a/lib/trustie/sms/sms.rb b/lib/trustie/sms/sms.rb
index 2cab61fa..33584a0c 100644
--- a/lib/trustie/sms/sms.rb
+++ b/lib/trustie/sms/sms.rb
@@ -31,6 +31,8 @@ module Trustie
params['text'] = ""
if send_type.nil?
params['text'] = "【Edu实训】" + code + "(手机验证码)。如非本人操作,请忽略。"
+ elsif send_type == "teacher_register"
+ params['text'] = "【Edu实训】亲爱的#{user_name},有新的老师#{name}注册啦,请尽快处理"
elsif send_type == 'competition_start'
params['text'] = "【Edu实训】亲爱的#{user_name},你参与的#{name}将于#{result}开始,请及时参赛"
Rails.logger.info "#{params['text']}"