소스 검색

增加商品属性定义

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