|
@@ -21,9 +21,11 @@ class Order < ActiveRecord::Base
|
|
|
# 更新order信息
|
|
# 更新order信息
|
|
|
od = Order.where("id = ?", self.id).first
|
|
od = Order.where("id = ?", self.id).first
|
|
|
if od.source=="sys"
|
|
if od.source=="sys"
|
|
|
|
|
+ od.depart=od.wx_user.depart
|
|
|
|
|
+ od.user_id=od.wx_user.user_id
|
|
|
|
|
+ od.status="processing"
|
|
|
od.order_type=0
|
|
od.order_type=0
|
|
|
od.pick_way=0
|
|
od.pick_way=0
|
|
|
- od.status="processing"
|
|
|
|
|
od.has_commission=false
|
|
od.has_commission=false
|
|
|
od.save
|
|
od.save
|
|
|
end
|
|
end
|
|
@@ -42,13 +44,12 @@ class Order < ActiveRecord::Base
|
|
|
|
|
|
|
|
wxUser = WxUser.where("id = ?", self.wx_user_id).first
|
|
wxUser = WxUser.where("id = ?", self.wx_user_id).first
|
|
|
|
|
|
|
|
- if wxUser.blank?
|
|
|
|
|
- self.errors.add(:wx_user_id,"微信ID不存在")
|
|
|
|
|
|
|
+ if !wxUser.blank?
|
|
|
|
|
+ self.depart=wxUser.depart
|
|
|
|
|
+ self.user_id=wxUser.user_id
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- self.depart=wxUser.depart
|
|
|
|
|
- self.user_id=wxUser.user_id
|
|
|
|
|
- self.status="processing"
|
|
|
|
|
|
|
+
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
|