浏览代码

增加订单导入功能

abiao 4 年之前
父节点
当前提交
704ae2aecc
共有 1 个文件被更改,包括 4 次插入4 次删除
  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