@ -83,6 +83,8 @@ class NewsController < ApplicationController
sort_type=@b_sort==1?"asc":"desc"
#scope = News.find_by_sql("select a.*,b.updated_at from news a, course_activities b where a.course_id = 532 and a.course_id = b.course_id and b.course_act_id = a.id ) ")
@ -2855,7 +2855,7 @@ class UsersController < ApplicationController
@c_sort=2
end
sort_name="created_at"
sort_name="updated_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}")
@ -2899,10 +2899,10 @@ class UsersController < ApplicationController
@c_sort=2
end
sort_name="created_on"
sort_name="updated_on"
sort_type=@c_sort==1?"asc":"desc"
@projects=@user.projects.visible.select("projects.*, (SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a #{sort_type}")
@projects=@user.projects.visible.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a #{sort_type}")