|
|
@@ -48,6 +48,7 @@ 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")
|
|
|
@@ -56,6 +57,7 @@ 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
|