|
|
@@ -24,14 +24,6 @@ class Product < ActiveRecord::Base
|
|
|
IMG_STORE_PATH = "product"
|
|
|
|
|
|
def v_share_img=file
|
|
|
- @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")
|
|
|
- @productAttrs.each do |attr|
|
|
|
- a=[attr.name,attr.id]
|
|
|
- SIZE_ENUM.push(a)
|
|
|
- end
|
|
|
- end
|
|
|
unless file.blank?
|
|
|
file_name = "#{UUID.new.generate[0...8].downcase}.jpg"
|
|
|
file_path = "#{IMG_STORE_PATH}/product/share/#{file_name}"
|