Commit 6ed8272b by liyijie

Fix catalog order by created_at; Add catlog info to product index API

parent 8b684408
json.extract! product, :id, :title, :status, :status_zh, json.extract! product, :id, :title, :status, :status_zh,
:need_express, :cover_image :need_express, :cover_image
json.default_series product.default_series, partial: 'shotengai/share/series_simple', as: :series json.catalog_list product.catalog_list if product.respond_to?(:catalog_list)
\ No newline at end of file json.default_series product.default_series, partial: 'shotengai/share/series_simple', as: :series
...@@ -144,7 +144,7 @@ module Shotengai ...@@ -144,7 +144,7 @@ module Shotengai
} }
define_method(list_name) { define_method(list_name) {
catalog_class.where(id: super().map { |tag| Shotengai::Catalog.parse_tag(tag) }).order(:nested_level) catalog_class.unscope(:order).where(id: super().map { |tag| Shotengai::Catalog.parse_tag(tag) }).order(:nested_level)
} }
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment