Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/pgfqe6ch8 into dev_aliyun

dev_aliyun
daiao 6 years ago
commit 71bc5df916

@ -782,7 +782,7 @@ class CompetitionsController < ApplicationController
challenges.each do |challenge| 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| 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? if outputs.present?
outputs = outputs.sort { |a, b| b[:text_scor].to_f <=> a[:text_scor].to_f } outputs = outputs.sort { |a, b| b[:text_scor].to_f <=> a[:text_scor].to_f }
myshixun_score = outputs.first.text_scor.to_f myshixun_score = outputs.first.text_scor.to_f

@ -159,20 +159,20 @@ class MyController < ApplicationController
# 认证 # 认证
@trail_authentication = ApplyAction.where(:user_id => User.current.id, :container_type => "TrialAuthorization").order("created_at desc").first # @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 # if @trail_authentication && (@trail_authentication.status == 1 || @trail_authentication.status == 2) && !@trail_authentication.noticed
@noticed_result = true # @noticed_result = true
@trail_authentication.update_attribute("noticed", 1) # @trail_authentication.update_attribute("noticed", 1)
elsif @user.certification != 1 && (@trail_authentication.nil? || @trail_authentication.try(:status) != 0) # 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 # 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 # 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 # @require_trail_auth = true
@user.user_day_certifications.update_all("status = 2") # @user.user_day_certifications.update_all("status = 2")
@certification_expired = 1 # @certification_expired = 1
elsif first_update.present? && (Time.now.to_i - first_update.created_at.to_i) > 86400 # elsif first_update.present? && (Time.now.to_i - first_update.created_at.to_i) > 86400
@require_trail_auth = true # @require_trail_auth = true
end # end
end # end
=begin =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? 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?

@ -3,11 +3,11 @@
<div class="clearfix font-16 mb30 title_detail"> <div class="clearfix font-16 mb30 title_detail">
<a href="<%= home_path %>" class="none"><img src="/images/educoder/logo.png" class="fl"/></a> <a href="<%= home_path %>" class="none"><img src="/images/educoder/logo.png" class="fl"/></a>
<span class="fr"> <span class="fr">
<% if @require_trail_auth %> <%# if @require_trail_auth %>
<a href="javascript:void(0)" onclick="apply_trial_box()" class="color-blue">试用申请</a> <!-- <a href="javascript:void(0)" onclick="apply_trial_box()" class="color-blue">试用申请</a>-->
<% else %> <%# else %>
<a href="<%= home_path %>" class="color-blue">返回首页</a> <a href="<%= home_path %>" class="color-blue">返回首页</a>
<% end %> <%# end %>
<em class="vertical-line ml5 mr5"></em> <em class="vertical-line ml5 mr5"></em>
<a href="<%= signout_path %>" class="color-blue">退出</a> <a href="<%= signout_path %>" class="color-blue">退出</a>
</span> </span>
@ -91,21 +91,21 @@
<script> <script>
$(function () { $(function () {
<% if @require_trail_auth %> <%# if @require_trail_auth %>
var html = "<%= escape_javascript(render :partial => 'welcome/two_btn_mask_pop') %>"; <!-- var html = "<%#= escape_javascript(render :partial => 'welcome/two_btn_mask_pop') %>";-->
pop_box_new(html, 500, 338,true); <!-- pop_box_new(html, 500, 338,true);-->
<% if @certification_expired.present? %> <%# if @certification_expired.present? %>
$("#apply_trial_text").html("您的账号授权已过期,继续使用需要经过授权审核<br>通过审核后,您将可以继续使用"); <!-- $("#apply_trial_text").html("您的账号授权已过期,继续使用需要经过授权审核<br>通过审核后,您将可以继续使用");-->
<% end %> <%# end %>
<% end %> <%# end %>
<% if @noticed_result %> <%# if @noticed_result %>
<% if @trail_authentication.status == 1 %> <%# if @trail_authentication.status == 1 %>
sure_box_redirect_without_newtab("<%= user_path(@user) %>", "试用申请已被接受"); <!-- sure_box_redirect_without_newtab("<%#= user_path(@user) %>", "试用申请已被接受");-->
<% elsif @trail_authentication.status == 2 %> <%# elsif @trail_authentication.status == 2 %>
sure_box_redirect_without_newtab_btn("<%= my_account_path %>", "试用申请已被拒绝<br/>原因:<%= [@trail_authentication.reason, @trail_authentication.reject_description].join('') %>", "重新申请"); <!-- sure_box_redirect_without_newtab_btn("<%#= my_account_path %>", "试用申请已被拒绝<br/>原因:<%#= [@trail_authentication.reason, @trail_authentication.reject_description].join('') %>", "重新申请");-->
<% end %> <%# end %>
<% end %> <%# end %>
<% notice = SystemUpdateNotice.last %> <% 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 %> <% 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 %> <% if @can_attendance %>
<a herf="javascript:void(0);" onclick="user_attendance('<%= @user.login %>');" id="attendance" class="user_default_btn user_orange_btn fl">签到</a> <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> <span id="attendance_span" style="display: none;" class="fl user_default_btn user_grey_btn mb5">已签到</span>
<% if @apply_trial %> <%# 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> <!-- <a herf="javascript:void(0);" onclick="user_apply_trail();" id="authentication_apply" class="user_default_btn user_private_btn fl ml15">试用申请</a>-->
<% end %> <%# end %>
<div class="clearfix"></div> <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> <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 %> <% else %>

Loading…
Cancel
Save