abiao лет назад: 5
Родитель
Сommit
b00fabcc8c
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      app/models/product.rb

+ 3 - 3
app/models/product.rb

@@ -24,9 +24,9 @@ class Product < ActiveRecord::Base
         end
         COLOR_ENUM.clear
         if COLOR_ENUM.length==0
-            @Color = ProductAttrConfig.where("product_id=? and size_types='color'",self.id).first
-            if !@Color.blank?
-                @productColorAttrs = ProductAttr.where("attr_key_id=?",@Color.id).order("recommend desc")
+            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.each do |color_attr|
                     b=[color_attr.name,color_attr.id]
                     COLOR_ENUM.push(b)