Merge branch 'dev_aliyun' into develop

develop
daiao 4 years ago
commit 937fb948ab

@ -869,7 +869,7 @@ class AccountController < ApplicationController
if ApplyUserAuthentication.where(:user_id => @user.id, :status => 0, :auth_type => 1).count == 0
ApplyUserAuthentication.create(:user_id => @user.id, :status => 0, :auth_type => 1)
begin
status = Trustie::Sms.send(mobile: '18711085785', send_type:'apply_auth' , name: '管理员')
status = Trustie::Sms.send(mobile: '15388083362', send_type:'apply_auth' , name: '管理员')
rescue => e
Rails.logger.error "发送验证码出错: #{e}"
end
@ -928,7 +928,7 @@ class AccountController < ApplicationController
if ApplyUserAuthentication.where(:user_id => @user.id, :status => 0, :auth_type => 2).count == 0
ApplyUserAuthentication.create(:user_id => @user.id, :status => 0, :auth_type => 2)
begin
status = Trustie::Sms.send(mobile: '18711085785', send_type:'apply_pro_certification' , name: '管理员')
status = Trustie::Sms.send(mobile: '15388083362', send_type:'apply_pro_certification' , name: '管理员')
rescue => e
Rails.logger.error "发送验证码出错: #{e}"
end
@ -937,7 +937,7 @@ class AccountController < ApplicationController
if File.exist?(diskfile2)
ApplyUserAuthentication.create(:user_id => @user.id, :status => 0, :auth_type => 2)
begin
status = Trustie::Sms.send(mobile: '18711085785', send_type:'apply_pro_certification' , name: '管理员')
status = Trustie::Sms.send(mobile: '15388083362', send_type:'apply_pro_certification' , name: '管理员')
rescue => e
Rails.logger.error "发送验证码出错: #{e}"
end

@ -569,7 +569,7 @@ class ShixunsController < ApplicationController
else
ApplyAction.create(:container_type => "ApplyShixun", :container_id => @shixun.id, :user_id => User.current.id, :status => 0)
begin
status = Trustie::Sms.send(mobile: '18711011226', send_type:'publish_shixun' , name: '管理员')
status = Trustie::Sms.send(mobile: '15388083362', send_type:'publish_shixun' , name: '管理员')
rescue => e
Rails.logger.error "发送验证码出错: #{e}"
end

@ -207,7 +207,7 @@ class SubjectsController < ApplicationController
# notes = User.current.show_name.to_s + " 申请发布课程实训:<a href='#{subject_path(@subject)}'>#{@subject.name}</a>"
# JournalsForMessage.create(:jour_id => 1, :jour_type => 'Principal', :user_id => User.current.id, :notes => notes, :private => 1, :reply_id => 0)
begin
status = Trustie::Sms.send(mobile: '18711011226', send_type:'publish_subject' , name: '管理员')
status = Trustie::Sms.send(mobile: '15388083362', send_type:'publish_subject' , name: '管理员')
rescue => e
Rails.logger.error "发送验证码出错: #{e}"
end

@ -28,6 +28,6 @@ class Libraries::SubmitService
Tiding.create!(user_id: 1, trigger_user_id: library.user_id,
container_id: library.id, container_type: 'Library',
tiding_type: 'Apply', status: 0)
Trustie::Sms.send(mobile: '18711011226', send_type:'publish_library' , name: '管理员') rescue nil
Trustie::Sms.send(mobile: '15388083362', send_type:'publish_library' , name: '管理员') rescue nil
end
end

@ -7,7 +7,7 @@ class StatisticSchoolDailyReportTask
teacher_count = users.where(created_on: yesterday, user_extensions: { identity: User::TEACHER }).count
student_count = users.where(created_on: yesterday, user_extensions: { identity: User::STUDENT }).count
prefessional_count = users.where(created_on: yesterday, user_extensions: { identity: User::ENTERPRISE }).count
professional_count = users.where(created_on: yesterday, user_extensions: { identity: User::ENTERPRISE }).count
# 活跃用户
active_user_ids = users.where(last_login_on: yesterday).pluck(:id)
@ -34,13 +34,13 @@ class StatisticSchoolDailyReportTask
.where(created_at: yesterday).reorder(nil).count
# 无有效数据时不记录
data = [teacher_count, student_count, prefessional_count, course_count, shixun_count, active_user_count,
data = [teacher_count, student_count, professional_count, course_count, shixun_count, active_user_count,
shixun_homework_count, shixun_evaluate_count]
next if data.all?(&:zero?)
create_params = {
school_id: school.id, school_name: school.name, teacher_increase_count: teacher_count,
student_increase_count: student_count, prefessional_increase_count: prefessional_count, course_increase_count: course_count,
student_increase_count: student_count, professional_increase_count: professional_count, course_increase_count: course_count,
shixun_homework_count: shixun_homework_count, shixun_evaluate_count: shixun_evaluate_count,
shixun_increase_count: shixun_count, active_user_count: active_user_count, date: current_date
}

@ -28,6 +28,9 @@ module Trustie
begin
u = find_user(user)
unless u.present?
if user.hashed_password.blank?
user.salt_password("edu12345678")
end
u = self.g.create_user(user.mail, user.hashed_password, name: user.show_name, username: user.login, confirm: "true")
Rails.logger.warn("create gitlab log ##user.mail is #{user.mail}, name is #{user.show_name}, u id is#{u.id}")
user.gid = u.id

Loading…
Cancel
Save