From 40a1e1d0341e536af7f731e6db6a7056a8287e7c Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 28 May 2019 09:49:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=8F=8D=E9=A6=88=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=A2=9E=E5=8A=A0=E8=B4=A6=E5=8F=B7=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=92=8C=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 851c50e6..0f62dbe8 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -4295,7 +4295,7 @@ end count_row = 1 shixuns = Shixun.where(:id => shixun_ids).includes(discusses: [:user]) sheet1.row(0).concat(["序号", "实训ID", "实训名称", "实训作者", "作者单位", "评论数", "评论内容", "关卡", "评论者", "评论者职业", - "评论者单位", "评论时间", "社区导师是否已回复"]) + "评论者单位", "评论时间", "社区导师是否已回复", "我的账号回复内容", "回复时间"]) shixuns.each_with_index do |shixun, i| discusses = shixun.discusses.where("user_id != ?", 1) if beginTime.present? @@ -4313,6 +4313,7 @@ end discusses.each_with_index do |discuss, j| user = discuss.user content = discuss.content.gsub(//, "【图片评论】").gsub(/!\[\].+\)/, "【图片评论】") + myself_discuss = discuss.children.where(user_id: User.current.id).last sheet1[count_row, 6] = strip_html content sheet1[count_row, 7] = "第#{discuss.position}关" sheet1[count_row, 8] = user.show_real_name @@ -4320,6 +4321,8 @@ end sheet1[count_row, 10] = user.school_name sheet1[count_row, 11] = format_time discuss.created_at sheet1[count_row, 12] = discuss.children.pluck(:user_id).include?(1) ? "是" : "否" + sheet1[count_row, 13] = myself_discuss.try(:content) + sheet1[count_row, 14] = myself_discuss ? (format_time myself_discuss.created_at) : "" count_row += 1 end #count_row += 1