Commit 4ce841da by ivan Lan

Update views about status

parent 02afbd12
json.current_page @resources.current_page
json.total_pages @resources.total_pages
json.set! @resources.klass.model_name.collection do
json.array! @resources, partial: 'shotengai/share/order_simple', as: :order
end
\ No newline at end of file
json.current_page @resources.current_page
json.total_pages @resources.total_pages
json.set! @resources.klass.model_name.collection do
json.array! @resources, partial: 'shotengai/share/product_simple', as: :product
end
json.partial! "shotengai/share/product", product: @resource
json.current_page @resources.current_page
json.total_pages @resources.total_pages
json.set! @resources.klass.model_name.collection do
json.array! @resources, partial: 'shotengai/share/series_simple', as: :series
end
json.current_page @resources.current_page
json.total_pages @resources.total_pages
json.set! @resources.klass.model_name.collection do
json.array! @resources, partial: 'shotengai/share/snapshot_simple', as: :snapshot
end
json.partial! "shotengai/share/snapshot", snapshot: @resource
json.extract! product, :id, :title, :status, :status_zh,
:need_express, :cover_image
\ No newline at end of file
:need_express, :cover_image
json.default_series product.default_series, partial: 'shotengai/share/series_simple', as: :series
\ No newline at end of file
json.extract! snapshot, :id, :original_price, :price, :count,
:product_status_zh, :order_status_zh,
:product_status_zh, :order_status_zh, :product_status, :order_status,
:total_price, :total_original_price, :revised_amount,
:spec, :cover_image, :banners, :detail, :meta
\ No newline at end of file
json.extract! snapshot, :id, :original_price, :price, :count,
:product_status_zh, :order_status_zh,
:product_status_zh, :order_status_zh, :product_status, :order_status,
:total_price, :total_original_price, :revised_amount,
:spec, :cover_image, :meta
\ No newline at end of file
......@@ -27,7 +27,7 @@ module Shotengai
# Using validates_uniqueness_of do not work if the order of Hash is diff
validate :uniq_spec
delegate :title, :detail, :banners, :cover_image, :status_zh, to: :product
delegate :title, :detail, :banners, :cover_image, :status, :status_zh, to: :product
scope :query_spec_with_product, ->(val, product) {
return none unless val.keys.sort == product.spec.keys.sort
......
......@@ -92,13 +92,11 @@ module Shotengai
count * original_price
end
def product_status_zh
series.status_zh
end
def order_status_zh
shotengai_order&.status_zh
end
def product_status; series.status end
def product_status_zh; series.status_zh end
def order_status; shotengai_order&.status end
def order_status_zh; shotengai_order&.status_zh 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