|
|
@@ -26,13 +26,13 @@ class Product < ActiveRecord::Base
|
|
|
COLOR_ENUM = []
|
|
|
def get_color_enum
|
|
|
COLOR_ENUM.clear
|
|
|
- if COLOR_ENUM.length ==0
|
|
|
+ if COLOR_ENUM.length==0
|
|
|
@Color = ProductAttrConfig.where("product_id=? and size_type='color'",self.id).first
|
|
|
if !@Color.blank?
|
|
|
- @productAttrs = ProductAttr.where("attr_key_id=?",@Color.id).order("recommend desc")
|
|
|
- @productAttrs.each do |attr|
|
|
|
- a=[attr.name,attr.id]
|
|
|
- COLOR_ENUM.push(a)
|
|
|
+ @productColorAttrs = ProductAttr.where("attr_key_id=?",@Color.id).order("recommend desc")
|
|
|
+ @productColorAttrs.each do |color_attr|
|
|
|
+ b=[color_attr.name,color_attr.id]
|
|
|
+ COLOR_ENUM.push(b)
|
|
|
end
|
|
|
end
|
|
|
end
|