From c18c99c7a73614378fd871dd46de4026a89e9f77 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 4 Apr 2019 16:05:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=9A=84=E5=AE=9E=E8=AE=AD=E5=8F=8D=E9=A6=88?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=8A=A0=E6=8C=89=E7=85=A7=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E6=97=B6=E9=97=B4=E6=A3=80=E7=B4=A2=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 13 +++++++++++- .../shixun_feedback_message.html.erb | 20 ++++++++++++++++++- .../shixun_feedback_message.js.erb | 2 +- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index f571b47c..372c2bac 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -792,12 +792,22 @@ class ManagementsController < ApplicationController @menu_type = 8 @sub_type = 2 @search = params[:search] + @beginTime = params[:beginTime] + @endTime = params[:endTime] if @search.present? shixun_ids = Shixun.where("name like ?", "%#{params[:search]}%").pluck(:id) @discusses = Discuss.where(:dis_type => "Shixun", :dis_id => shixun_ids).reorder("created_at desc") else @discusses = Discuss.where(:dis_type => "Shixun").reorder("created_at desc") 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 @discusses_count = @discusses.count @limit = 20 @@ -4230,7 +4240,8 @@ end sheet1[count_row, 5] = discusses.count discusses.each_with_index do |discuss, j| user = discuss.user - sheet1[count_row, 6] = discuss.content.gsub(//, "【图片评论】").gsub(/!\[\].+\)/, "【图片评论】") + content = discuss.content.gsub(//, "【图片评论】").gsub(/!\[\].+\)/, "【图片评论】") + sheet1[count_row, 6] = strip_html content sheet1[count_row, 7] = "第#{discuss.position}关" sheet1[count_row, 8] = user.show_real_name sheet1[count_row, 9] = user.identity diff --git a/app/views/managements/shixun_feedback_message.html.erb b/app/views/managements/shixun_feedback_message.html.erb index c987f283..ff4ecebe 100644 --- a/app/views/managements/shixun_feedback_message.html.erb +++ b/app/views/managements/shixun_feedback_message.html.erb @@ -2,11 +2,17 @@ <%= form_tag(url_for(shixun_feedback_message_managements_path), :id => "managements_shixuns_search", :method => "post", :remote => true ) do %> <% end %>
@@ -17,4 +23,16 @@ function clearSearchCondition(){ $("#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 + }); \ No newline at end of file diff --git a/app/views/managements/shixun_feedback_message.js.erb b/app/views/managements/shixun_feedback_message.js.erb index 135f4107..89ead852 100644 --- a/app/views/managements/shixun_feedback_message.js.erb +++ b/app/views/managements/shixun_feedback_message.js.erb @@ -1,2 +1,2 @@ $("#management_shixun_feedback_list").html("<%= j(render :partial => 'shixun_feedback_list') %>"); -$("#shixun_search").attr("href", "<%= shixun_feedback_message_managements_path(:search => @search, :format => "xls") %>") \ No newline at end of file +$("#shixun_search").attr("href", "<%= shixun_feedback_message_managements_path(:search => @search, :beginTime => @beginTime, :endTime => @endTime,:format => "xls") %>") \ No newline at end of file