修改课程默认排序方式
This commit is contained in:
parent
583c022048
commit
cab092cd04
|
@ -328,15 +328,15 @@ class ProjectsController < ApplicationController
|
||||||
else
|
else
|
||||||
@offset ||= @project_pages.reverse_offset
|
@offset ||= @project_pages.reverse_offset
|
||||||
unless @offset == 0
|
unless @offset == 0
|
||||||
@projects_status = @projects_status.reorder('changesets_count').offset(@offset).limit(@limit).all.reverse
|
@projects_status = @projects_status.offset(@offset).limit(@limit).all.reverse
|
||||||
else
|
else
|
||||||
limit = @project_count % @limit
|
limit = @project_count % @limit
|
||||||
if limit == 0
|
if limit == 0
|
||||||
limit = @limit
|
limit = @limit
|
||||||
end
|
end
|
||||||
@projects_status = @projects_status.reorder('changesets_count').offset(@offset).limit(limit).all.reverse
|
@projects_status = @projects_status.offset(@offset).limit(limit).all.reverse
|
||||||
end
|
end
|
||||||
@s_type = 1
|
@s_type = 0
|
||||||
# @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
|
# @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
|
||||||
# @projects = @projects[@offset, @limit]
|
# @projects = @projects[@offset, @limit]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue