Procházet zdrojové kódy

增加商品属性定义

abiao před 5 roky
rodič
revize
3777847d3a
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 4 4
      app/models/product.rb

+ 4 - 4
app/models/product.rb

@@ -12,20 +12,18 @@ class Product < ActiveRecord::Base
     COLOR_ENUM =  []
     def get_size_enum
         SIZE_ENUM.clear
-=begin
         if SIZE_ENUM.length ==0
             linkSize = ProductAttrConfig.where("product_id=? and size_type='size'",self.id).first
             if !linkSize.blank?
-                productAttrs = ProductAttr.where("attr_key_id=?",linkSize.id).order("recommend desc")
+                productAttrs = ProductAttr.where("attr_key_id=?",linkSize.attr_key_id).order("recommend desc")
                 productAttrs.each do |attr|
                     a=[attr.name,attr.id]
                     SIZE_ENUM.push(a)
                 end
             end
         end
-=end
 
-        #COLOR_ENUM.clear
+        COLOR_ENUM.clear
         if COLOR_ENUM.length==0
             linkColor = ProductAttrConfig.where("product_id=? and size_type='color'",self.id).first
             if !linkColor.blank?
@@ -231,11 +229,13 @@ class Product < ActiveRecord::Base
             field :virtual_sold_count
             field :purchase_limit_count
             field :share_content
+=begin
             field :v_share_img, :file_upload do
                  pretty_value do
                      bindings[:view].tag(:img, {:src => bindings[:object].get_share_img, :class => 'preview'})
                 end
             end
+=end
             field :seckill_start
             field :seckill_end
             field :seckill_price