소스 검색

增加订单导入功能

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