Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_aliyun
杨树明 5 years ago
commit 6d9bbb70e3

@ -782,7 +782,7 @@ class CompetitionsController < ApplicationController
challenges.each do |challenge|
Game.where(:challenge_id => challenge.id, :user_id => user_ids, :status => 2).select{|game| game.open_time >= s_time && game.end_time <= e_time }.each do |game|
outputs = game.outputs.select{|output| !output.text_scor.nil? }
outputs = game.outputs.select{|output| !output.text_scor.nil? && output.created_at <= e_time }
if outputs.present?
outputs = outputs.sort { |a, b| b[:text_scor].to_f <=> a[:text_scor].to_f }
myshixun_score = outputs.first.text_scor.to_f

@ -1105,12 +1105,12 @@ end
school_ids = School.where("schools.name like '%#{params[:school]}%'").pluck(:id)
school_ids = school_ids.size == 0 ? "(-1)" : "(" + school_ids.join(",") + ")"
location = params[:location] && params[:location] != "0" ? params[:location] : ""
@team_members = @team_members.where("user_extensions.school_id in #{school_ids} and schools.province like '%#{location}%'")
@team_members = @team_members.includes(user: { user_extensions: :school }).where("user_extensions.school_id in #{school_ids} and schools.province like '%#{location}%'")
end
@page = params[:page] || 1
@team_members = @team_members.reorder("team_members.created_at #{@order}")
all_members = @team_members
@team_members = paginateHelper(@team_members.includes(competition_team: [:user, teachers: :user], user: { user_extensions: :school }), 50)
@team_members = paginateHelper(@team_members.preload(competition_team: [:user, teachers: :user], user: { user_extensions: :school }), 50)
respond_to do |format|
format.js
format.html
@ -3425,7 +3425,7 @@ end
users = users.where(schools: { province: params[:province] })
end
users = users.select('distinct users.*').order("last_login_on desc")
users = users.select('distinct users.*')
@page = (params['page'] || 1).to_i
@users_count = users.count
@ -3433,16 +3433,17 @@ end
@is_remote = true
@users_pages = Paginator.new @users_count, @limit, params['page'] || 1
@offset ||= @users_pages.offset
@users = paginateHelper users.preload(:real_name_authentication_apply, :professional_authentication_apply,
@users = paginateHelper users.order("last_login_on desc").preload(:real_name_authentication_apply, :professional_authentication_apply,
user_extensions: [:department, :school]), @limit
respond_to do |format|
format.js
format.xls{
# @export_shixun_task = @export_shixun_task.all
@xls_users = users.reorder("created_on desc").limit(3000) #导出excel用户
@xls_users = users.limit(3000) #导出excel用户
@xls_users = @xls_users.includes(:real_name_authentication_apply, :professional_authentication_apply,
user_extensions: [:department, :school])
filename = "用户列表.xls"
send_data(user_list_xls(@xls_users), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
}

@ -159,20 +159,20 @@ class MyController < ApplicationController
# 认证
@trail_authentication = ApplyAction.where(:user_id => User.current.id, :container_type => "TrialAuthorization").order("created_at desc").first
if @trail_authentication && (@trail_authentication.status == 1 || @trail_authentication.status == 2) && !@trail_authentication.noticed
@noticed_result = true
@trail_authentication.update_attribute("noticed", 1)
elsif @user.certification != 1 && (@trail_authentication.nil? || @trail_authentication.try(:status) != 0)
first_update = Grade.where(:user_id => @user.id, :container_id => @user.id, :container_type => 'Account').first
if first_update.present? && (Time.now.to_i - first_update.created_at.to_i) > 86400 && @user.user_day_certifications.last.present? && @user.user_day_certifications.last.status == 1
@require_trail_auth = true
@user.user_day_certifications.update_all("status = 2")
@certification_expired = 1
elsif first_update.present? && (Time.now.to_i - first_update.created_at.to_i) > 86400
@require_trail_auth = true
end
end
# @trail_authentication = ApplyAction.where(:user_id => User.current.id, :container_type => "TrialAuthorization").order("created_at desc").first
# if @trail_authentication && (@trail_authentication.status == 1 || @trail_authentication.status == 2) && !@trail_authentication.noticed
# @noticed_result = true
# @trail_authentication.update_attribute("noticed", 1)
# elsif @user.certification != 1 && (@trail_authentication.nil? || @trail_authentication.try(:status) != 0)
# first_update = Grade.where(:user_id => @user.id, :container_id => @user.id, :container_type => 'Account').first
# if first_update.present? && (Time.now.to_i - first_update.created_at.to_i) > 86400 && @user.user_day_certifications.last.present? && @user.user_day_certifications.last.status == 1
# @require_trail_auth = true
# @user.user_day_certifications.update_all("status = 2")
# @certification_expired = 1
# elsif first_update.present? && (Time.now.to_i - first_update.created_at.to_i) > 86400
# @require_trail_auth = true
# end
# end
=begin
if @user.nickname.nil? || @user.lastname.nil? || ue.try(:identity).nil? || (ue.try(:identity) == 1 && ue.try(:student_id).blank?) || (ue.try(:identity) != 1 && ue.try(:technical_title).blank?) || ue.try(:location).nil? || ue.try(:location_city).nil? || ue.try(:gender).nil? || ue.try(:school_id).nil?

@ -15,4 +15,7 @@ $("#user_export_list").attr("href", "<%= search_user_managements_path(:trial =>
:homepage_show => params[:homepage_show],
:te_technical_title => params[:te_technical_title],
:pro_technical_title => params[:pro_technical_title],
:province => params[:province],
:trial_whether => params[:trial_whether],
:realname => params[:realname],
:format => "xls") %>");

@ -3,11 +3,11 @@
<div class="clearfix font-16 mb30 title_detail">
<a href="<%= home_path %>" class="none"><img src="/images/educoder/logo.png" class="fl"/></a>
<span class="fr">
<% if @require_trail_auth %>
<a href="javascript:void(0)" onclick="apply_trial_box()" class="color-blue">试用申请</a>
<% else %>
<%# if @require_trail_auth %>
<!-- <a href="javascript:void(0)" onclick="apply_trial_box()" class="color-blue">试用申请</a>-->
<%# else %>
<a href="<%= home_path %>" class="color-blue">返回首页</a>
<% end %>
<%# end %>
<em class="vertical-line ml5 mr5"></em>
<a href="<%= signout_path %>" class="color-blue">退出</a>
</span>
@ -91,21 +91,21 @@
<script>
$(function () {
<% if @require_trail_auth %>
var html = "<%= escape_javascript(render :partial => 'welcome/two_btn_mask_pop') %>";
pop_box_new(html, 500, 338,true);
<% if @certification_expired.present? %>
$("#apply_trial_text").html("您的账号授权已过期,继续使用需要经过授权审核<br>通过审核后,您将可以继续使用");
<% end %>
<% end %>
<%# if @require_trail_auth %>
<!-- var html = "<%#= escape_javascript(render :partial => 'welcome/two_btn_mask_pop') %>";-->
<!-- pop_box_new(html, 500, 338,true);-->
<%# if @certification_expired.present? %>
<!-- $("#apply_trial_text").html("您的账号授权已过期,继续使用需要经过授权审核<br>通过审核后,您将可以继续使用");-->
<%# end %>
<%# end %>
<% if @noticed_result %>
<% if @trail_authentication.status == 1 %>
sure_box_redirect_without_newtab("<%= user_path(@user) %>", "试用申请已被接受");
<% elsif @trail_authentication.status == 2 %>
sure_box_redirect_without_newtab_btn("<%= my_account_path %>", "试用申请已被拒绝<br/>原因:<%= [@trail_authentication.reason, @trail_authentication.reject_description].join('') %>", "重新申请");
<% end %>
<% end %>
<%# if @noticed_result %>
<%# if @trail_authentication.status == 1 %>
<!-- sure_box_redirect_without_newtab("<%#= user_path(@user) %>", "试用申请已被接受");-->
<%# elsif @trail_authentication.status == 2 %>
<!-- sure_box_redirect_without_newtab_btn("<%#= my_account_path %>", "试用申请已被拒绝<br/>原因:<%#= [@trail_authentication.reason, @trail_authentication.reject_description].join('') %>", "重新申请");-->
<%# end %>
<%# end %>
<% notice = SystemUpdateNotice.last %>
<% if User.current.certification == 1 && notice.present? && notice.end_time > Time.now && notice.start_time >= (Time.now - 21600) && User.current.user_system_notices.where(:notice_type => notice.notice_type).count == 0 %>

@ -133,9 +133,9 @@
<% if @can_attendance %>
<a herf="javascript:void(0);" onclick="user_attendance('<%= @user.login %>');" id="attendance" class="user_default_btn user_orange_btn fl">签到</a>
<span id="attendance_span" style="display: none;" class="fl user_default_btn user_grey_btn mb5">已签到</span>
<% if @apply_trial %>
<a herf="javascript:void(0);" onclick="user_apply_trail();" id="authentication_apply" class="user_default_btn user_private_btn fl ml15">试用申请</a>
<% end %>
<%# if @apply_trial %>
<!-- <a herf="javascript:void(0);" onclick="user_apply_trail();" id="authentication_apply" class="user_default_btn user_private_btn fl ml15">试用申请</a>-->
<%# end %>
<div class="clearfix"></div>
<span id="attendance_notice" class="none font-12 color-grey-6">明日签到&nbsp;<font class="color-orange">+<%= @next_attachment_score < 100 ? (@next_attachment_score + 10) : 100 %></font>&nbsp;金币</span>
<% else %>

Loading…
Cancel
Save