瀏覽代碼

增加商品属性定义

abiao 5 年之前
父節點
當前提交
6b14674885
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      app/models/product.rb

+ 2 - 1
app/models/product.rb

@@ -9,7 +9,7 @@ class Product < ActiveRecord::Base
     TYPE_ENUM = [["直营","direct_sale"]]
     #["代销","user_sale"]
 
-    SIZE_ENUM =  [["大码",1]]
+    SIZE_ENUM =  []
     def get_size_enum
         @Size = ProductAttrConfig.where("product_id=? and type='size'",self.id).first
         @productAttrs = ProductAttr.where("attr_key_id=?",@Size.id).order("recommend desc")
@@ -105,6 +105,7 @@ class Product < ActiveRecord::Base
             field :is_only_new
             field :video_state
             field :size_id, :enum do
+                get_size_enum
                 enum do
                     SIZE_ENUM
                 end