|
|
@@ -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不存在")
|