|
|
|
@ -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(/<img.*\/>/, "【图片评论】").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
|
|
|
|
|