|
|
@@ -45,8 +45,23 @@ class OrderDetail < ActiveRecord::Base
|
|
|
baseDt.save
|
|
|
else
|
|
|
#生成套装商品明细
|
|
|
-
|
|
|
-
|
|
|
+ items = ProductItem.where("product_id = ?", record[:product_id])
|
|
|
+ items.each do |item|
|
|
|
+ pd = Product.where("id = ?", item.item_id).first
|
|
|
+ unless pd.blank?
|
|
|
+ baseDt = BaseDetail.new
|
|
|
+ baseDt.order_no=od.order_id
|
|
|
+ baseDt.dt_id=detail.id
|
|
|
+ baseDt.is_zeng=detail.is_zeng
|
|
|
+ baseDt.nums=detail.nums
|
|
|
+ baseDt.depart=order.depart
|
|
|
+ baseDt.product_id=pd.id
|
|
|
+ baseDt.order_id=od.id
|
|
|
+ baseDt.price=pd.price
|
|
|
+ baseDt.product_name=pd.name
|
|
|
+ baseDt.save
|
|
|
+ end
|
|
|
+ end
|
|
|
end
|
|
|
end
|
|
|
|