Fix frontend display order
This commit is contained in:
parent
8f85d8939f
commit
4e3a86469d
|
@ -1,7 +1,7 @@
|
||||||
class WebResourcesController < ApplicationController
|
class WebResourcesController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
links = WebLink.order_by(:created_at=>'desc').filter_by_categories
|
links = WebLink.can_display.filter_by_categories
|
||||||
web_link = links.collect do |link|
|
web_link = links.collect do |link|
|
||||||
statuses = link.statuses.collect do |status|
|
statuses = link.statuses.collect do |status|
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,7 @@ class WebResourcesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def widget
|
def widget
|
||||||
links = WebLink.order_by(:created_at=>'desc').filter_by_widget_categories
|
links = WebLink.can_display.filter_by_widget_categories
|
||||||
web_link = links.collect do |link|
|
web_link = links.collect do |link|
|
||||||
statuses = link.statuses.collect do |status|
|
statuses = link.statuses.collect do |status|
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,7 @@ class WebLink
|
||||||
field :create_user_id
|
field :create_user_id
|
||||||
field :update_user_id
|
field :update_user_id
|
||||||
|
|
||||||
scope :can_display, ->{where(is_hidden: false).order_by([:is_top, :desc])}
|
scope :can_display, ->{where(is_hidden: false).order_by([:is_top,:desc],[:created_at,:desc])}
|
||||||
|
|
||||||
before_save :add_http
|
before_save :add_http
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue