From 4489bc13d7c312b92f91c2eaf09c193144c5b7cf Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 3 May 2016 18:17:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8=E6=8C=89?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 75661e543..f8bf70933 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2948,7 +2948,7 @@ class UsersController < ApplicationController sort_name = "created_at" sort_type = @c_sort == 1 ? "asc" : "desc" - @courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a #{sort_type}") + @courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a #{sort_type}") #根据 作业+资源数排序 if @order.to_i == 2