|
|
|
@ -863,19 +863,19 @@ class ManagementsController < ApplicationController
|
|
|
|
|
# 评测时间列表
|
|
|
|
|
def evaluate_records
|
|
|
|
|
shixun_tomcat = Redmine::Configuration['shixun_tomcat']
|
|
|
|
|
uri = "#{shixun_tomcat}/bridge/monitor/getPodsInfo"
|
|
|
|
|
res = uri_exec uri, params
|
|
|
|
|
if res['code'] == 0
|
|
|
|
|
@pod_num = res['sum']
|
|
|
|
|
@pod_dis = JSON.parse(res['distr']) if res['distr'].present?
|
|
|
|
|
end
|
|
|
|
|
#uri = "#{shixun_tomcat}/bridge/monitor/getPodsInfo"
|
|
|
|
|
#res = uri_exec uri, params
|
|
|
|
|
#if res['code'] == 0
|
|
|
|
|
@pod_num = 1 # res['sum']
|
|
|
|
|
@pod_dis = [{ip: 1, num: 1}] #JSON.parse(res['distr']) if res['distr'].present?
|
|
|
|
|
#end
|
|
|
|
|
|
|
|
|
|
page = (params['page'] || 1).to_i
|
|
|
|
|
search = params[:search]
|
|
|
|
|
keyword = params[:keyword]
|
|
|
|
|
limit = 20
|
|
|
|
|
|
|
|
|
|
if search
|
|
|
|
|
if search.present?
|
|
|
|
|
if "u_name" == keyword
|
|
|
|
|
@evaluate_recods = EvaluateRecord.joins("join users u on evaluate_records.user_id = u.id").where("concat(u.lastname, u.firstname) like '%#{search}%'")
|
|
|
|
|
# @evaluate_recods = EvaluateRecord.where(user_id: User.where("concat(lastname, firstname) like '%#{search}%'").pluck(:id))
|
|
|
|
@ -884,7 +884,12 @@ class ManagementsController < ApplicationController
|
|
|
|
|
# @evaluate_recods = EvaluateRecord.where(user_id: UserExtensions.where(school_id: School.where("name like '%#{search}%'").pluck(:id)).pluck(:user_id))
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
@evaluate_recods = EvaluateRecord.where("0=0")
|
|
|
|
|
@evaluate_recods = EvaluateRecord.where(nil)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if params[:beginTime].present?
|
|
|
|
|
endTime = params[:endTime].present? ? params[:endTime] : Time.now
|
|
|
|
|
@evaluate_recods = @evaluate_recods.where("created_at >= ? and created_at <= ?", params[:beginTime], endTime)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@evaluate_recods_count = @evaluate_recods.count
|
|
|
|
|