Ver código fonte

增加订单导入功能

abiao 4 anos atrás
pai
commit
d583d8074b
1 arquivos alterados com 3 adições e 2 exclusões
  1. 3 2
      app/models/order.rb

+ 3 - 2
app/models/order.rb

@@ -31,7 +31,7 @@ class Order < ActiveRecord::Base
 
     def before_save
 
-        unless  self.express_company.nil?
+        unless self.express_company.nil?
             if self.express_company.length>0
                 express = ExpressCompany.where("express_company = ?", self.express_company).first
                 if !express.blank?
@@ -39,7 +39,8 @@ class Order < ActiveRecord::Base
                 end
             end
         end
-        wxUser = WxUser.where("express_company = ?", self.express_company).first
+
+        wxUser = WxUser.where("id = ?", self.wx_user_id).first
 
         if wxUser.blank?
             self.errors.add("微信ID不存在")