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

dev_local
cxt 6 years ago
commit 30a5b1a4e6

@ -792,12 +792,22 @@ class ManagementsController < ApplicationController
@menu_type = 8 @menu_type = 8
@sub_type = 2 @sub_type = 2
@search = params[:search] @search = params[:search]
@beginTime = params[:beginTime]
@endTime = params[:endTime]
if @search.present? if @search.present?
shixun_ids = Shixun.where("name like ?", "%#{params[:search]}%").pluck(:id) shixun_ids = Shixun.where("name like ?", "%#{params[:search]}%").pluck(:id)
@discusses = Discuss.where(:dis_type => "Shixun", :dis_id => shixun_ids).reorder("created_at desc") @discusses = Discuss.where(:dis_type => "Shixun", :dis_id => shixun_ids).reorder("created_at desc")
else else
@discusses = Discuss.where(:dis_type => "Shixun").reorder("created_at desc") @discusses = Discuss.where(:dis_type => "Shixun").reorder("created_at desc")
end end
if params[:beginTime] && params[:beginTime].strip != ""
@discusses = @discusses.where("created_at >= '#{Time.parse(params[:beginTime])}'")
end
if params[:endTime] && params[:endTime].strip != ""
@discusses = @discusses.where("created_at <= '#{Time.parse(params[:endTime])}'")
end
@all_discusses = @discusses @all_discusses = @discusses
@discusses_count = @discusses.count @discusses_count = @discusses.count
@limit = 20 @limit = 20
@ -4241,7 +4251,8 @@ end
sheet1[count_row, 5] = discusses.count sheet1[count_row, 5] = discusses.count
discusses.each_with_index do |discuss, j| discusses.each_with_index do |discuss, j|
user = discuss.user user = discuss.user
sheet1[count_row, 6] = discuss.content.gsub(/<img.*\/>/, "【图片评论】").gsub(/!\[\].+\)/, "【图片评论】") content = discuss.content.gsub(/<img.*\/>/, "【图片评论】").gsub(/!\[\].+\)/, "【图片评论】")
sheet1[count_row, 6] = strip_html content
sheet1[count_row, 7] = "#{discuss.position}" sheet1[count_row, 7] = "#{discuss.position}"
sheet1[count_row, 8] = user.show_real_name sheet1[count_row, 8] = user.show_real_name
sheet1[count_row, 9] = user.identity sheet1[count_row, 9] = user.identity

@ -2,11 +2,17 @@
<%= form_tag(url_for(shixun_feedback_message_managements_path), :id => "managements_shixuns_search", :method => "post", :remote => true ) do %> <%= form_tag(url_for(shixun_feedback_message_managements_path), :id => "managements_shixuns_search", :method => "post", :remote => true ) do %>
<div class="edu-con-top clearfix mb20"> <div class="edu-con-top clearfix mb20">
<input class="fl task-form-20 task-height-30 ml25" id="shixun_Look_name" name="search" maxlength="" placeholder="输入实训名称关键字进行搜索" type="text" style="height: 21px;"> <input class="fl task-form-20 task-height-30 ml25" id="shixun_Look_name" name="search" maxlength="" placeholder="输入实训名称关键字进行搜索" type="text" style="height: 21px;">
<li class="fl">
<span class="mr10 ml10 font-14">发布时间</span>
<input type="text" name="beginTime" readonly placeholder="请选择开始时间" class="winput-150-30 mr10"/>
<input type="text" name="endTime" readonly placeholder="请选择结束时间" class="winput-150-30"/>
</li>
<li class="fl ml10"> <li class="fl ml10">
<a href="javascript:void(0)" class="task-btn task-btn-orange" onclick="$('#managements_shixuns_search').submit();">搜索</a> <a href="javascript:void(0)" class="task-btn task-btn-orange" onclick="$('#managements_shixuns_search').submit();">搜索</a>
<a href="javascript:clearSearchCondition();" class="task-btn mr10">清除</a> <a href="javascript:clearSearchCondition();" class="task-btn mr10">清除</a>
</li> </li>
<a href="<%= shixun_feedback_message_managements_path(:search => @search, :format => "xls") %>" id="shixun_search" class="task-btn mr10 task-btn-orange fr">导出</a> <a href="<%= shixun_feedback_message_managements_path(:search => @search, :beginTime => @beginTime, :endTime => @endTime,:format => "xls") %>" id="shixun_search" class="task-btn mr10 task-btn-orange fr">导出</a>
</div> </div>
<% end %> <% end %>
<div class="ex_container" id="management_shixun_feedback_list"> <div class="ex_container" id="management_shixun_feedback_list">
@ -17,4 +23,16 @@
function clearSearchCondition(){ function clearSearchCondition(){
$("#shixun_Look_name").val('') $("#shixun_Look_name").val('')
} }
$("input[name='beginTime']").datetimepicker({
allowBlank:true,
lang:'ch',
format:'Y-m-d H:i',
validateOnBlur:false
});
$("input[name='endTime']").datetimepicker({
allowBlank:true,
lang:'ch',
format:'Y-m-d H:i',
validateOnBlur:false
});
</script> </script>

@ -1,2 +1,2 @@
$("#management_shixun_feedback_list").html("<%= j(render :partial => 'shixun_feedback_list') %>"); $("#management_shixun_feedback_list").html("<%= j(render :partial => 'shixun_feedback_list') %>");
$("#shixun_search").attr("href", "<%= shixun_feedback_message_managements_path(:search => @search, :format => "xls") %>") $("#shixun_search").attr("href", "<%= shixun_feedback_message_managements_path(:search => @search, :beginTime => @beginTime, :endTime => @endTime,:format => "xls") %>")
Loading…
Cancel
Save