瀏覽代碼

增加商品属性定义

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

+ 1 - 1
app/models/product.rb

@@ -62,7 +62,7 @@ class Product < ActiveRecord::Base
         if COLOR_ENUM.length==0
             linkColor = ProductAttrConfig.where("product_id=? and size_type='color'",self.id).first
             if !linkColor.blank?
-                productColorAttrs = ProductAttr.where("attr_key_id=?",linkColor.id).order("recommend desc")
+                productColorAttrs = ProductAttr.where("attr_key_id=?",linkColor.attr_key_id).order("recommend desc")
                 productColorAttrs.each do |color_attr|
                     b=[color_attr.name,color_attr.id]
                     COLOR_ENUM.push(b)