Sfoglia il codice sorgente

增加订单导入功能

abiao 4 anni fa
parent
commit
7b1a3ff888
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3 3
      app/models/order.rb

+ 3 - 3
app/models/order.rb

@@ -17,9 +17,9 @@ class Order < ActiveRecord::Base
 
     before_save :before_save
     after_update :patch_send_product
-    after_create :import_orders
+    #after_create :import_orders
 
-    def import_orders
+    def after_import_save(record)
         # 更新order信息
         od = Order.where("id = ?", self.id).first
         if od.source=="sys"
@@ -30,7 +30,7 @@ class Order < ActiveRecord::Base
             od.paied_at=od.paied_time.to_i
 
         end
-        wxUser = WxUser.where("id = ?", od.wx_user_id).first
+        wxUser = WxUser.where("id = ?", record[:wx_user_id]).first
         unless wxUser.blank?
             od.depart=wxUser.depart
             od.user_id=wxUser.user_id