|
|
@@ -11,6 +11,7 @@ class Product < ActiveRecord::Base
|
|
|
|
|
|
SIZE_ENUM = []
|
|
|
def get_size_enum
|
|
|
+=begin
|
|
|
@Size = ProductAttrConfig.where("product_id=? and size_type='size'",self.id).first
|
|
|
if !@Size.blank?
|
|
|
@productAttrs = ProductAttr.where("attr_key_id=?",@Size.id).order("recommend desc")
|
|
|
@@ -19,6 +20,7 @@ class Product < ActiveRecord::Base
|
|
|
SIZE_ENUM.push(a)
|
|
|
end
|
|
|
end
|
|
|
+=end
|
|
|
return "--"
|
|
|
end
|
|
|
IMG_STORE_PATH = "product"
|
|
|
@@ -48,7 +50,6 @@ class Product < ActiveRecord::Base
|
|
|
end
|
|
|
|
|
|
def gross_interest_rate
|
|
|
-=begin
|
|
|
@Size = ProductAttrConfig.where("product_id=? and size_type='size'",self.id).first
|
|
|
if !@Size.blank?
|
|
|
@productAttrs = ProductAttr.where("attr_key_id=?",@Size.id).order("recommend desc")
|
|
|
@@ -57,7 +58,6 @@ class Product < ActiveRecord::Base
|
|
|
SIZE_ENUM.push(a)
|
|
|
end
|
|
|
end
|
|
|
-=end
|
|
|
rate = 0
|
|
|
if self.buy_price != 0 && self.price != 0
|
|
|
rate = (( self.price.to_f - self.buy_price.to_f )/self.buy_price.to_f)*100
|