Bläddra i källkod

增加订单导入功能

abiao 4 år sedan
förälder
incheckning
704ae2aecc
1 ändrade filer med 4 tillägg och 4 borttagningar
  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