Forráskód Böngészése

增加订单导入功能

abiao 4 éve
szülő
commit
704ae2aecc
1 módosított fájl, 4 hozzáadás és 4 törlés
  1. 4 4
      app/models/order_detail.rb

+ 4 - 4
app/models/order_detail.rb

@@ -9,10 +9,10 @@ class OrderDetail < ActiveRecord::Base
   validate :order_validation
   after_create :import_orders
   def before_import_save(record)
-    pd = Product.where("id = ?", record.product_id).first
-    pd = Product.where("id = ?", record.product_id).first
-    pd = Product.where("id = ?", record.product_id).first
-    pd = Product.where("id = ?", record.product_id).first
+    pd = Product.where("id = ?", record[:product_id]).first
+    pd = Product.where("id = ?", record[:product_id]).first
+    pd = Product.where("id = ?", record[:product_id]).first
+    pd = Product.where("id = ?", record[:product_id]).first
   end
 
   def import_orders