项目、课程列表增加更新时间
This commit is contained in:
parent
96e7c9d134
commit
8b672cc7c3
|
@ -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 ) ")
|
||||
|
||||
scope = @course ? @course.news.course_visible : News.course_visible
|
||||
news_arr = scope.map{|news| news.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}")
|
||||
|
||||
#根据 问题+资源数排序 @project.project_score.issue_num @project.project_score.attach_num
|
||||
if @order.to_i == 2
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
<span class="grayTxt">
|
||||
创建时间:<%= format_time(course.created_at) %>
|
||||
</span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(course.updated_at) %></span>
|
||||
<span class="grayTxt">
|
||||
开课学期: <span><%= current_time_and_term course %></span>
|
||||
</span>
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
<div class="cl"></div>
|
||||
<li class="ml15">
|
||||
<span class="grayTxt">创建时间:<%= format_time(project.created_on) %></span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(project.updated_on) %></span>
|
||||
<p class="list-info fr grayTxt"><span><%= project.project_score.issue_num %></span><span>问题</span><span>|</span><span> <%= project.project_score.attach_num %></span><span>资源</span></p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
|
|
Loading…
Reference in New Issue