dev_haigong
hjm 6 years ago
commit f811f4a927

@ -1038,7 +1038,7 @@ class AccountController < ApplicationController
apply_action = ApplyAction.where(:user_id => User.current.id, :container_type => "TrialAuthorization", :status => 0).first apply_action = ApplyAction.where(:user_id => User.current.id, :container_type => "TrialAuthorization", :status => 0).first
school_ids = School.where(:auto_users_trial => 1).map(&:id) school_ids = School.where(:auto_users_trial => 1).map(&:id)
user_ex = User.current.user_extensions user_ex = User.current.user_extensions
if (user_ex.identity == 0 || (user_ex.identity == 1 && user_ex.student_id.present?)) && !user_ex.school.nil? && school_ids.include?(user_ex.school_id) if user_ex.identity == 1 && user_ex.student_id.present? && !user_ex.school.nil? && school_ids.include?(user_ex.school_id)
User.current.update_attributes(:certification => 1) User.current.update_attributes(:certification => 1)
logger.warn("apply_trail #######{User.current.login} ****#{User.current.user_extensions.school_id}") logger.warn("apply_trail #######{User.current.login} ****#{User.current.user_extensions.school_id}")
@tip = "申请已提交我们将在1分钟内完成审核" @tip = "申请已提交我们将在1分钟内完成审核"

@ -65,15 +65,62 @@ class ApplicationController < ActionController::Base
include Redmine::MenuManager::MenuController include Redmine::MenuManager::MenuController
helper Redmine::MenuManager::MenuHelper helper Redmine::MenuManager::MenuHelper
def ecloud_auth ucloud_user_id # 云启训练场EduCoder个人版 产品编码appId 9200108
euser = EcloudUser.where("id =? and opttype not in(3, 5)", ucloud_user_id).first # 产品名称 计费类型 套餐编码
if euser.present? # 开通过业务 # 云启训练场EduCoder个人版 固定包月 9200108001
# # 固定包月 9200108002
else # 固定包月 9200108003
false # ---------------------------------------------------
end # 产品名称 计费类型 套餐编码
# 云启训练场EduCoder院校版 包月+按license 9200109001
# 包月+按license 9200109002
# 云启训练场EduCoder院校版 产品编码appId 9200109
def ecloud_auth subject_id
# euser = EcloudUser.where("userid =? and opttype not in(3, 5)", User.current.id).first
# if euser.present? # 开通过业务
# # 获取用户的套餐信息
# e_service = euser.ecloud_services.where("opttype != 1")
# # 如果用户开通过服务
# if e_service.present?
# if e_service.count >1 # 说明有重复开通过业务
# else
# code = e_service.first.try(:code)
#
# end
# end
# else
# false # 没开通过服务,或者服务被禁用则不允许访问
# end
#
#
#
#
# if e_service.count > 1 # 说明有重复订购过套餐
# else
# code = e_service.try(:code)
# end
# service_count = euser.ecloud_services.where("opttype != 1").try(:code)
#
# end
# 如果不是Ecloud过来的用户则不改变用户的使用状态及权限按现有模式即可
end
# 根据业务确定权限
def ecloud_services_auth code, subject_id
subject = Subject.find(subject_id)
subject_level = subject.subject_level_system.try(:level)
# case code
# when "9200108001"
# subject_level.to_i == 1 ? true : false
# when "9200108002"
#
# end
# end
end end
def ec_public_auth major_school def ec_public_auth major_school
unless User.current.admin? || major_school.template_major || major_school.school.users.where(:id => User.current.id).count > 0 || unless User.current.admin? || major_school.template_major || major_school.school.users.where(:id => User.current.id).count > 0 ||
major_school.ec_major_school_users.where(:user_id => User.current.id).count > 0 || major_school.ec_major_school_users.where(:user_id => User.current.id).count > 0 ||

@ -43,7 +43,7 @@ class EcloudController < ApplicationController
CLIENT_ID = '1056' CLIENT_ID = '1056'
CLIENT_SECRET = '2e84256a-3de4-4713-9e02-10ee88a14592' CLIENT_SECRET = '2e84256a-3de4-4713-9e02-10ee88a14592'
SERVER_URL = "https://221.176.53.130:44390/services/" SERVER_URL = "https://221.176.53.130:44390/services/"
q
## 签名 ## 签名
@ -63,12 +63,12 @@ class EcloudController < ApplicationController
begin begin
if params['opttype'] == 0 # 开通企业/个人业务 if params['opttype'] == 0 # 开通企业/个人业务
ecloud = Ecloud.create!(eloud_params) ecloud = Ecloud.create!(eloud_params)
create_service(params['services'], ecloud.try(:id)) create_service(params['services'], ecloud.try(:id)) if params['services'].present?
create_product_params(params['productparas'], ecloud.try(:id)) if params['productparas'].present? create_product_params(params['productparas'], ecloud.try(:id)) if params['productparas'].present?
# 为管理员添加一条记录 # 为管理员添加一条记录
# 开通的时候都是用户的opttype也是0 # 开通的时候都是用户的opttype也是0
# 如果管理员已经存在,则不用重复开通 # 如果管理员已经存在,则不用重复开通
euser = EcloudUser.where(id: params['userid'], custid: params['custid']).first euser = EcloudUser.where(userid: params['userid'], custid: params['custid']).first
unless euser unless euser
EcloudUser.create!(custid: params['custid'], opttype: params['opttype'], userid: params['userid'], EcloudUser.create!(custid: params['custid'], opttype: params['opttype'], userid: params['userid'],
username: params['username'], useralias: params['useralias'], username: params['username'], useralias: params['useralias'],
@ -96,7 +96,8 @@ class EcloudController < ApplicationController
elsif params['opttype'] == 1 # 业务变更 elsif params['opttype'] == 1 # 业务变更
ecloud = Ecloud.where(custid: params['custid'], custcode: params['custcode'], productcode: params['productcode']).first ecloud = Ecloud.where(custid: params['custid'], custcode: params['custcode'], productcode: params['productcode']).first
# 套餐变更 # 套餐变更
# 新增业务 # 操作代码 0新增业务1注销业务2修改业务
# # 新增服务
add_service = params['services'].select{|s| s['opttype'] == 0} add_service = params['services'].select{|s| s['opttype'] == 0}
create_service(add_service, ecloud.try(:id)) if add_service.present? create_service(add_service, ecloud.try(:id)) if add_service.present?
@ -114,8 +115,8 @@ class EcloudController < ApplicationController
if edt_services.present? if edt_services.present?
edt_services.each do |es| edt_services.each do |es|
ese = EcloudService.where(ecloud_id: ecloud.try(:id), code: es['code']).first ese = EcloudService.where(ecloud_id: ecloud.try(:id), code: es['code']).first
ese.update_attributes!(opttype: es['opttype'], begintime: es['begintime'], endtime: es['endtime']) ese.update_attributes!(opttype: es['opttype'], begintime: es['begintime'], endtime: es['endtime']) if ese.present?
create_serviceparas es['serviceparas'].first, ese.id create_serviceparas(es['serviceparas'].first, ese.id) if ese.present?
end end
end end
@ -128,6 +129,7 @@ class EcloudController < ApplicationController
# ecloud_id = ecloud.try(:id) # ecloud_id = ecloud.try(:id)
elsif params['opttype'] == 4 # 再次重复开通 elsif params['opttype'] == 4 # 再次重复开通
# 再次申请开通,这种情况就是累加时间
ecloud = Ecloud.where(custid: params['custid'], custcode: params['custcode'], productcode: params['productcode']).first ecloud = Ecloud.where(custid: params['custid'], custcode: params['custcode'], productcode: params['productcode']).first
create_service(params['services'], ecloud.try(:id)) create_service(params['services'], ecloud.try(:id))
create_product_params(params['productparas'], ecloud.try(:id)) if params['productparas'].present? create_product_params(params['productparas'], ecloud.try(:id)) if params['productparas'].present?

@ -2104,25 +2104,36 @@ end
condition = (params[:research_condition].nil? || params[:research_condition] == "name") ? "concat(lastname, firstname)" : params[:research_condition] condition = (params[:research_condition].nil? || params[:research_condition] == "name") ? "concat(lastname, firstname)" : params[:research_condition]
if 0 == status if 0 == status
if params[:research_condition] == "phone" && params[:research_contents].blank? if params[:research_condition] == "phone" && params[:research_contents].blank?
@users = User.order("#{@order_key} #{@us_order}") @users = User.where(nil)
else else
@users = User.where("#{condition} like '%#{params[:research_contents]}%'").order("#{@order_key} #{@us_order}") @users = User.where("#{condition} like '%#{params[:research_contents]}%'")
end end
else else
if params[:research_condition] == "phone" && params[:research_contents].blank? if params[:research_condition] == "phone" && params[:research_contents].blank?
@users = User.where(:status => status).order("#{@order_key} #{@us_order}") @users = User.where(:status => status)
else else
@users = User.where("status = #{status} and #{condition} like '%#{params[:research_contents]}%'").order("#{@order_key} #{@us_order}") @users = User.where("status = #{status} and #{condition} like '%#{params[:research_contents]}%'")
end end
end end
if params[:identity] && params[:identity].to_i != -1
@users = @users.includes(:user_extensions).where("user_extensions.identity = ?", params[:identity].to_i)
end
if params[:auto_school] && params[:auto_school].to_i != 0
@users = @users.includes(:user_extensions => [:school]).where("schools.auto_users_trial = ?", params[:auto_school].to_i == 1 ? 1 : 0)
end
if params[:school] && params[:school] != '' if params[:school] && params[:school] != ''
school_name = params[:school] school_name = params[:school]
school = School.where("name like '%#{school_name}%'") school = School.where("name like '%#{school_name}%'")
school_id = school.map(&:id) school_id = school.map(&:id)
user_id = UserExtensions.where(:school_id => school_id).map(&:user_id) user_id = UserExtensions.where(:school_id => school_id).map(&:user_id)
@users = @users.where(:id => user_id).order("#{@order_key} #{@us_order}") @users = @users.where(:id => user_id)
end end
@users = @users.order("#{@order_key} #{@us_order}")
@page = (params['page'] || 1).to_i @page = (params['page'] || 1).to_i
@users_count = @users.count @users_count = @users.count
@limit = 20 @limit = 20
@ -3186,25 +3197,44 @@ end
search = params[:search] search = params[:search]
@status = trial_authorization_status(params[:status]) @status = trial_authorization_status(params[:status])
# @status = (params[:status].blank? || params[:status] == "0") ? 0 : [1,2] # @status = (params[:status].blank? || params[:status] == "0") ? 0 : [1,2]
if search.blank? user_id = []
@authorizations = ApplyAction.where(:container_type => "TrialAuthorization", :status => @status).includes(:user) search = false
else @authorizations = ApplyAction.where(:container_type => "TrialAuthorization", :status => @status)
user_id = User.find_by_sql("select id from users where concat(lastname,firstname) like '%#{search}%'")
@authorizations = ApplyAction.where(:container_type => "TrialAuthorization", :status => @status, :user_id => user_id).includes(:user) unless search.blank?
user_id = User.find_by_sql("select id from users where concat(lastname,firstname) like '%#{search}%'").map(&:id)
end end
if params[:sname] && params[:sname] != '' if params[:sname] && params[:sname].strip != ''
school_id = School.where("name like '%#{params[:sname]}%'") school_id = School.where("name like '%#{params[:sname]}%'")
user_id = UserExtensions.where(:school_id => school_id).map(&:user_id) new_user_id = UserExtensions.where(:school_id => school_id).map(&:user_id)
@authorizations = @authorizations.where(:user_id => user_id).order("updated_at desc") user_id = user_id.size == 0 ? new_user_id : user_id & new_user_id
search = true
end
if params[:identity] && params[:identity].to_i != -1
new_user_id = UserExtensions.where(:identity => params[:identity].to_i).map(&:user_id)
user_id = user_id.size == 0 ? new_user_id : user_id & new_user_id
search = true
end end
if params[:auto_school] && params[:auto_school].to_i != 0
school_id = School.where(auto_users_trial: params[:auto_school].to_i == 1 ? 1 : 0)
new_user_id = UserExtensions.where(:school_id => school_id).map(&:user_id)
user_id = user_id.size == 0 ? new_user_id : user_id & new_user_id
search = true
end
@authorizations = user_id.size == 0 && !search ? @authorizations.order("updated_at desc") : @authorizations.where(:user_id => user_id.uniq).order("updated_at desc")
@autu_count = @authorizations.count @autu_count = @authorizations.count
@limit = 15 @limit = 15
@is_remote = true @is_remote = true
@autu_pages = Paginator.new @autu_count, @limit, params['page'] || 1 @autu_pages = Paginator.new @autu_count, @limit, params['page'] || 1
@offset ||= @autu_pages.offset @offset ||= @autu_pages.offset
@authorizations = paginateHelper @authorizations, @limit @authorizations = paginateHelper @authorizations, @limit
@authorizations = @authorizations.includes(:user)
respond_to do |format| respond_to do |format|
format.js format.js
format.html format.html

@ -113,7 +113,7 @@ class StudentWorkController < ApplicationController
pass_consume_time += (game.cost_time / 60.0).to_f pass_consume_time += (game.cost_time / 60.0).to_f
end end
all_time += (game.cost_time / 60.0).to_f all_time += (game.cost_time / 60.0).to_f
user_total_score += game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i user_total_score += game.status == 2 ? game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i : 0
if myshixun.user_id == @work.user.id if myshixun.user_id == @work.user.id
@game_user_query << [game.id, game.outputs.first.try(:query_index).to_i] @game_user_query << [game.id, game.outputs.first.try(:query_index).to_i]
end end

@ -5,7 +5,7 @@ module ShixunsHelper
def myshixun_exp myshixun def myshixun_exp myshixun
score = 0 score = 0
myshixun.games.each do |game| myshixun.games.each do |game|
score += game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i score += game.status == 2 ? game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i : 0
end end
score score
end end

@ -1,3 +1,4 @@
# 操作代码 0新增业务1注销业务2修改业务
class EcloudService < ActiveRecord::Base class EcloudService < ActiveRecord::Base
attr_accessible :begintime, :code, :endtime, :opttype, :ecloud_id, :packagecode, :bossorderid attr_accessible :begintime, :code, :endtime, :opttype, :ecloud_id, :packagecode, :bossorderid
belongs_to :ecloud belongs_to :ecloud

@ -1693,31 +1693,37 @@ class User < Principal
end end
def self.create_with_ecoder!(info) def self.create_with_ecoder!(info)
user = User.new user = User.find_by_phone(info["mobile"])
user.admin = false
user.login = "ecoder_" + info["mobile"]
user.phone = info["mobile"] # 如果手机号存在,则直接绑定用户
# 因为手机号可以取回密码,所以可以视为同一用户
unless user
user = User.new
user.admin = false
user.login = "ecoder_" + info["mobile"]
unless User.find_by_mail(info["email"]) user.phone = info["mobile"]
user.mail = info["email"]
end unless User.find_by_mail(info["email"])
user.nickname = info["username"] user.mail = info["email"]
end
user.nickname = info["username"]
user.activate user.activate
user.last_login_on = Time.now user.last_login_on = Time.now
user.ecoder_user_id = info["userid"] user.ecoder_user_id = info["userid"]
user.save!(:validate => false) user.save!(:validate => false)
UserStatus.create!(:user_id => user.id, :changsets_count => 0, :watchers_count => 0) UserStatus.create!(:user_id => user.id, :changsets_count => 0, :watchers_count => 0)
ue = user.user_extensions ||= UserExtensions.new ue = user.user_extensions ||= UserExtensions.new
ue.user_id = user.id ue.user_id = user.id
ue.save! ue.save!
end
user user
end end

@ -65,15 +65,9 @@
}else{ }else{
var order = "desc" var order = "desc"
} }
var user_status = $("input[name='user_status']").val(); $("input[name='us_order']").val(order);
var research_condition = $("input[name='research_condition']").val(); $("input[name='order_key']").val("created_on");
var research_contents = $("input[name='research_contents']").val(); $("#managements_users_search").submit();
$.ajax({
url: "<%= users_managements_path %>",
type: "post",
dataType: "script",
data: {us_order : order, order_key: "created_on", user_status:user_status, research_condition:research_condition, research_contents:research_contents}
});
}); });
// 按最后登录时间排序 // 按最后登录时间排序
$("#user_last_order").on("click", function(){ $("#user_last_order").on("click", function(){
@ -83,15 +77,9 @@
}else{ }else{
var order = "desc" var order = "desc"
} }
var user_status = $("input[name='user_status']").val(); $("input[name='us_order']").val(order);
var research_condition = $("input[name='research_condition']").val(); $("input[name='order_key']").val("last_login_on");
var research_contents = $("input[name='research_contents']").val(); $("#managements_users_search").submit();
$.ajax({
url: "<%= users_managements_path %>",
type: "post",
dataType: "script",
data: {us_order : order, order_key: "last_login_on", user_status:user_status, research_condition:research_condition, research_contents:research_contents}
});
}); });
// 按经验值排序 // 按经验值排序
$("#user_experience_order").on("click", function(){ $("#user_experience_order").on("click", function(){
@ -101,16 +89,10 @@
}else{ }else{
var order = "desc" var order = "desc"
} }
var user_status = $("input[name='user_status']").val(); $("input[name='us_order']").val(order);
var research_condition = $("input[name='research_condition']").val(); $("input[name='order_key']").val("experience");
var research_contents = $("input[name='research_contents']").val(); $("#managements_users_search").submit();
$.ajax({ });
url: "<%= users_managements_path %>",
type: "post",
dataType: "script",
data: {us_order : order, order_key: "experience", user_status:user_status, research_condition:research_condition, research_contents:research_contents}
});
})
// 按金币排序 // 按金币排序
$("#user_grade_order").on("click", function(){ $("#user_grade_order").on("click", function(){
@ -120,14 +102,8 @@
}else{ }else{
var order = "desc" var order = "desc"
} }
var user_status = $("input[name='user_status']").val(); $("input[name='us_order']").val(order);
var research_condition = $("input[name='research_condition']").val(); $("input[name='order_key']").val("grade");
var research_contents = $("input[name='research_contents']").val(); $("#managements_users_search").submit();
$.ajax({
url: "<%= users_managements_path %>",
type: "post",
dataType: "script",
data: {us_order : order, order_key: "grade", user_status:user_status, research_condition:research_condition, research_contents:research_contents}
});
}) })
</script> </script>

@ -28,11 +28,22 @@
<div id="edu-tab-con-2" class="undis"> <div id="edu-tab-con-2" class="undis">
<div class="mt10"> <div class="mt10">
<p class="fl task-form-40 mt8 ml15 clearfix"> <p class="fl task-form-20 mt8 ml15 clearfix">
<a href="javascript:void(0);" class="edu-filter-cir-grey mr5 fl font-12 active" id="audit_all_authentication">全部</a> <a href="javascript:void(0);" class="edu-filter-cir-grey mr5 fl font-12 active" id="audit_all_authentication">全部</a>
<a href="javascript:void(0);" class="edu-filter-cir-grey mr5 fl font-12" id="audit_agree_authentication">同意</a> <a href="javascript:void(0);" class="edu-filter-cir-grey mr5 fl font-12" id="audit_agree_authentication">同意</a>
<a href="javascript:void(0);" class="edu-filter-cir-grey mr5 fl font-12" id="audit_reject_authentication" >拒绝</a> <a href="javascript:void(0);" class="edu-filter-cir-grey mr5 fl font-12" id="audit_reject_authentication" >拒绝</a>
</p> </p>
<select id="user_identity" name="identity" class="fl winput-120-40 ml15 mt5">
<option value="-1">请选择职业</option>
<option value="0">教师</option>
<option value="1">学生</option>
<option value="2">专业人士</option>
</select>
<select id="auto_school" name="auto_school" class="fl winput-120-40 ml15 mt5">
<option value="0">全部</option>
<option value="1">自动授权</option>
<option value="2">非自动授权</option>
</select>
<div class="edu-position fr task-form-30 mb10 fr mr15"> <div class="edu-position fr task-form-30 mb10 fr mr15">
<input class="task-form-100 panel-box-sizing " placeholder="输入真实姓名进行检索" type="text" id="audit_search_name"> <input class="task-form-100 panel-box-sizing " placeholder="输入真实姓名进行检索" type="text" id="audit_search_name">
<a href="javascript:void(0);" class="edu-btn-search font-16 color-grey mt10" id="audit_search"><i class="fa fa-search"></i></a> <a href="javascript:void(0);" class="edu-btn-search font-16 color-grey mt10" id="audit_search"><i class="fa fa-search"></i></a>
@ -91,59 +102,55 @@
}); });
/* ----------------------- 已审批(全部) ------------------------- */ /* ----------------------- 已审批(全部) ------------------------- */
$("#audit_all_authentication").on("click", function(){ $("#audit_all_authentication").on("click", function(){search_func([1, 2]);});
var iName = $("#audit_search_name").val();
var sName = $("#school_search_name").val();
$.ajax({
url: "<%= trial_authorization_managements_path %>" + ".js",
data: { name: iName, status: [1, 2], sname: sName }
});
});
/* ----------------------- 已审批(同意) ------------------------- */ /* ----------------------- 已审批(同意) ------------------------- */
$("#audit_agree_authentication").live("click", function(){ $("#audit_agree_authentication").live("click", function(){search_func(1);});
var iName = $("#audit_search_name").val();
var sName = $("#school_search_name").val();
$.ajax({
url: "<%= trial_authorization_managements_path %>" +".js",
data: { name: iName, status: 1, sname: sName}
});
});
/* ----------------------- 已审批(拒绝) ------------------------- */ /* ----------------------- 已审批(拒绝) ------------------------- */
$("#audit_reject_authentication").live("click", function(){ $("#audit_reject_authentication").live("click", function(){search_func(2);});
var iName = $("#audit_search_name").val();
var sName = $("#school_search_name").val();
$.ajax({ /* ------------------- 按名字进行搜索(已审批)-------------------- */
url: "<%= trial_authorization_managements_path %>" +".js", $("#audit_search").live("click", function(){search_func(0);});
data: { name: iName, status: 2, sname: sName } $("#user_identity").on("change", function(){search_func(0);});
}); $("#auto_school").on("change", function(){search_func(0);});
$("#audit_search_name, #school_search_name").on("keydown", function(e){
// 兼容FF和IE和Opera
var theEvent = e || window.event;
var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
if (code == 13) {
//回车执行查询
search_func(0);
}
}); });
/* ------------------- 按名字进行搜索(已审批)-------------------- */ function search_func(status){
$("#audit_search").live("click", function(){
var iName = $("#audit_search_name").val(); var iName = $("#audit_search_name").val();
var sName = $("#school_search_name").val(); var sName = $("#school_search_name").val();
var identity = $("#user_identity").val();
var auto_school = $("#auto_school").val();
var type = status;
var id = $("#audit_all_authentication").parent().find(".active").attr("id"); if(type == 0){
var type = 0; var id = $("#audit_all_authentication").parent().find(".active").attr("id");
if(id == "audit_all_authentication"){ if(id == "audit_all_authentication"){
type = [1, 2]; type = [1, 2];
}else if(id=="audit_agree_authentication"){ }else if(id=="audit_agree_authentication"){
type = 1; type = 1;
}else{ }else{
type = 2; type = 2;
}
} }
// alert(type);
$.ajax({ $.ajax({
url: "<%= trial_authorization_managements_path %>" +".js", url: "<%= trial_authorization_managements_path %>" +".js",
data: { search: iName, status: type, sname: sName} data: { search: iName, status: type, sname: sName, identity: identity, auto_school: auto_school}
}); });
}); }
// $(document).keyup(function(event){ // $(document).keyup(function(event){
// if(event.keyCode == 13){ // if(event.keyCode == 13){

@ -1,40 +1,56 @@
<div class="edu-class-top mt15 clearfix bor-grey-e"> <div class="edu-class-top mt15 clearfix bor-grey-e">
<%= form_tag(url_for(users_managements_path), :id => "managements_users_search", :method => "post", :remote => true) do %> <%= form_tag(url_for(users_managements_path), :id => "managements_users_search", :method => "post", :remote => true) do %>
<div class=" edu-position edu-admin-select fl mr10" style="width:140px;" > <div class=" edu-position edu-admin-select fl mr10" style="width:140px;">
<p>全部状态<i class="fa fa-caret-down ml10" ></i></p> <p>全部状态<i class="fa fa-caret-down ml10"></i></p>
<input type="hidden" name="user_status" value="0"> <input type="hidden" name="user_status" value="0">
<ul class="edu-admin-option"> <ul class="edu-admin-option">
<li data-val="0">全部状态</li> <li data-val="0">全部状态</li>
<li data-val="1">活动的(<%= query_user_status_num 1 %></li> <li data-val="1">活动的(<%= query_user_status_num 1 %></li>
<li data-val="2">未激活(<%= query_user_status_num 2 %></li> <li data-val="2">未激活(<%= query_user_status_num 2 %></li>
<li data-val="3">已锁定(<%= query_user_status_num 3 %></li> <li data-val="3">已锁定(<%= query_user_status_num 3 %></li>
</ul> </ul>
</div> </div>
<div class="edu-position edu-admin-select fl mr10" style="width:150px;"> <div class="edu-position edu-admin-select fl mr10" style="width:120px;">
<p>真实姓名搜索<i class="fa fa-caret-down ml10"></i></p> <p>真实姓名搜索<i class="fa fa-caret-down ml10"></i></p>
<input type="hidden" name="research_condition" value="name"> <input type="hidden" name="research_condition" value="name">
<ul class="edu-admin-option"> <ul class="edu-admin-option">
<li data-val="name">真实姓名搜索</li> <li data-val="name">真实姓名搜索</li>
<li data-val="login">用户id搜索</li> <li data-val="login">用户id搜索</li>
<li data-val="mail">邮箱地址搜索</li> <li data-val="mail">邮箱地址搜索</li>
<li data-val="phone">手机号码搜索</li> <li data-val="phone">手机号码搜索</li>
</ul> </ul>
</div> </div>
<div class="fl with20">
<input type="text" class="fl task-form-100 task-height-40 panel-box-sizing" name="research_contents" placeholder="输入关键字进行搜索">
</div>
<li class="fl task-height-30 ml10" style="display: inline-block">
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="school" class="task-height-40 panel-box-sizing fl" type="text" placeholder="请输入单位名称关键字进行搜索" style="width: 260px" />
<input nhname="tag" nh_tag_5="true" class="fl" id="school_id" name="school_id" style="display:none;" type="text"/> <!-- 单位名称的test框选中下拉列表框的id -->
<div class="cl"></div>
</li>
<div id="search_school_result_list" style="width: 330px;line-height: 1.5;min-height:20px; max-height: 200px; height: auto !important;display:none;background: white;overflow: scroll;border: solid 1px #cccccc; overflow-x: hidden; overflow-y: auto;">
</div>
<a href="javascript:void(0);" class="fl task-btn task-btn-orange ml5 mt5" onclick="$('#managements_users_search').submit();">搜索</a> <select id="user_identity" name="identity" class="fl winput-100-40 ml10">
<a href="javascript:void(0);" class="fl task-btn ml5 mt5" id="clear_contents">清除</a> <option value="-1">请选择职业</option>
<option value="0">教师</option>
<option value="1">学生</option>
<option value="2">专业人士</option>
</select>
<select id="auto_school" name="auto_school" class="fl winput-100-40 ml10">
<option value="0">全部</option>
<option value="1">自动授权</option>
<option value="2">非自动授权</option>
</select>
<!-- <a href="javascript:void(0);" class="fr task-btn task-btn-green mt5"> 新建用户</a>--> <div class="fl with15 ml10">
<input type="text" class="fl task-form-100 task-height-40 panel-box-sizing" name="research_contents" placeholder="输入关键字进行搜索">
</div>
<li class="fl task-height-30 ml10" style="display: inline-block">
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="school" class="task-height-40 panel-box-sizing fl" type="text" placeholder="请输入单位名称关键字进行搜索" style="width: 200px"/>
<input nhname="tag" nh_tag_5="true" class="fl" id="school_id" name="school_id" style="display:none;" type="text"/> <!-- 单位名称的test框选中下拉列表框的id -->
<div class="cl"></div>
</li>
<div id="search_school_result_list" style="width: 330px;line-height: 1.5;min-height:20px; max-height: 200px; height: auto !important;display:none;background: white;overflow: scroll;border: solid 1px #cccccc; overflow-x: hidden; overflow-y: auto;">
</div>
<input type="hidden" name="us_order" value="">
<input type="hidden" name="order_key" value="">
<a href="javascript:void(0);" class="fl task-btn task-btn-orange ml5 mt5" onclick="$('#managements_users_search').submit();">搜索</a>
<a href="javascript:void(0);" class="fl task-btn ml5 mt5" id="clear_contents">清除</a>
<!-- <a href="javascript:void(0);" class="fr task-btn task-btn-green mt5"> 新建用户</a>-->
<a href="javascript:void(0);" onclick="import_course_members();" class="fr task-btn task-btn-orange mt5">课堂添加成员</a> <a href="javascript:void(0);" onclick="import_course_members();" class="fr task-btn task-btn-orange mt5">课堂添加成员</a>
<% end %> <% end %>
</div> </div>
@ -42,7 +58,7 @@
<%= render :partial => "managements/user_list" %> <%= render :partial => "managements/user_list" %>
</div> </div>
<script> <script>
function import_course_members(){ function import_course_members() {
var htmlvalue = '<%= escape_javascript(render :partial => 'student_work/import_excel_score') %>'; var htmlvalue = '<%= escape_javascript(render :partial => 'student_work/import_excel_score') %>';
pop_box_new(htmlvalue, 452, 163); pop_box_new(htmlvalue, 452, 163);
$("#submit_url").val('<%= import_course_members_managements_path() %>'); $("#submit_url").val('<%= import_course_members_managements_path() %>');
@ -56,7 +72,7 @@
var d_count = 0; //查询结果的总量 var d_count = 0; //查询结果的总量
var d_maxPage = 0;//最大页面值 var d_maxPage = 0;//最大页面值
function department_search_fn(e) { function department_search_fn(e) {
if($(e.target).val().trim() == ''){ if ($(e.target).val().trim() == '') {
$("#search_school_result_list").hide(); $("#search_school_result_list").hide();
$("input[name='school_id']").val(""); $("input[name='school_id']").val("");
return; return;
@ -94,9 +110,10 @@
} }
}); });
} }
//修改部门 //修改部门
function changeSchoolValue(value, data) { function changeSchoolValue(value, data) {
console.log(value+","+data) console.log(value + "," + data)
$("input[name='school']").val(value); $("input[name='school']").val(value);
$("input[name='school_id']").val(data); $("input[name='school_id']").val(data);
$("#search_school_result_list").hide(); $("#search_school_result_list").hide();

@ -76,12 +76,12 @@
<span class="delay ml10">延时</span> <span class="delay ml10">延时</span>
<% end %> <% end %>
</td> </td>
<td><%= game.try(:open_time).nil? ? "--" : format_time(game.open_time) %></td> <td><%= game.try(:open_time).nil? || game.status == 3 ? "--" : format_time(game.open_time) %></td>
<% user_query = @game_user_query.select{|user_query| user_query[0] == game.id} %> <% user_query = @game_user_query.select{|user_query| user_query[0] == game.id} %>
<td><%= user_query.blank? ? "--" : user_query.first[1] %></td> <td><%= user_query.blank? ? "--" : user_query.first[1] %></td>
<td><%= game.try(:end_time).nil? ? "--" : format_time(game.end_time) %></td> <td><%= game.try(:end_time).nil? ? "--" : format_time(game.end_time) %></td>
<td><%= game.consumes_time %></td> <td><%= game.consumes_time %></td>
<td><%= game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i %> / <%= game.challenge.st == 1 ? game.challenge.choose_score : game.challenge.score %></td> <td><%= game.status == 2 ? (game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i) : 0 %> / <%= game.challenge.st == 1 ? game.challenge.choose_score : game.challenge.score %></td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

@ -284,6 +284,7 @@ a.color-red-dd:hover{color: #C61616!important;}
.winput-120-35{width: 120px;height: 35px;padding: 5px;box-sizing: border-box;} .winput-120-35{width: 120px;height: 35px;padding: 5px;box-sizing: border-box;}
.winput-120-30{width: 120px;height: 30px;padding: 5px;box-sizing: border-box;} .winput-120-30{width: 120px;height: 30px;padding: 5px;box-sizing: border-box;}
.winput-115-40{width: 115px;height: 40px;padding: 5px;box-sizing: border-box;} .winput-115-40{width: 115px;height: 40px;padding: 5px;box-sizing: border-box;}
.winput-100-40{width: 100px;height: 40px;padding: 5px;box-sizing: border-box;}
.winput-90-40{width: 90px;height: 40px;padding: 5px;box-sizing: border-box;} .winput-90-40{width: 90px;height: 40px;padding: 5px;box-sizing: border-box;}
.winput-90-35{width: 90px;height: 35px;padding: 5px;box-sizing: border-box;} .winput-90-35{width: 90px;height: 35px;padding: 5px;box-sizing: border-box;}
.winput-240-100{width: 240px;height: 100px;padding: 5px;box-sizing: border-box;} .winput-240-100{width: 240px;height: 100px;padding: 5px;box-sizing: border-box;}

Loading…
Cancel
Save