From 9d42443a29217595bbdaef60863a9b95e4db351f Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 26 May 2017 16:13:15 +0800 Subject: [PATCH] added date --- app/controllers/member_counselors_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/member_counselors_controller.rb b/app/controllers/member_counselors_controller.rb index dcce5d4..1fceef8 100644 --- a/app/controllers/member_counselors_controller.rb +++ b/app/controllers/member_counselors_controller.rb @@ -45,8 +45,9 @@ class MemberCounselorsController < CUserController page = Page.where(:page_id => params[:page_id]).first files = [] members.each do |member| - member.hps_files.each do |file| + member.hps_files.desc(:created_at).each do |file| files << { + "date" => file.created_at.strftime("%Y/%m/%d"), "title" => file.title, "download_count" => file.download_count, "url" => "/cuser/download?file_id=#{file.id.to_s}"