|
@@ -8,8 +8,11 @@ class ProductItem < ActiveRecord::Base
|
|
|
if self.product_id > 0
|
|
if self.product_id > 0
|
|
|
prd = Product.where("id = ?", self.product_id).first
|
|
prd = Product.where("id = ?", self.product_id).first
|
|
|
if prd.blank?
|
|
if prd.blank?
|
|
|
- self.errors.add(:product_id,"商品不存在,请重新填写商品ID")
|
|
|
|
|
|
|
+ self.errors.add(:product_id,"商品不存在,请重新填写商品ID")
|
|
|
else
|
|
else
|
|
|
|
|
+ if !prd.package
|
|
|
|
|
+ self.errors.add(:product_id,"商品非套装商品,请重新录入!")
|
|
|
|
|
+ end
|
|
|
self.title=prd.name
|
|
self.title=prd.name
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|