@@ -4,7 +4,14 @@ class ShopApplication < ActiveRecord::Base
self.table_name = "shop_applications"
DEPART_ENUM= [["部门1",1], ["部门2",2], ["部门3", 3], ["部门4", 4], ["部门5", 5]]
belongs_to :depart_record, :foreign_key => :depart
+ before_save :before_save
+ def before_save
+ wxUser = WxUser.where("id = ?", self.wx_user_id).first
+ if !wxUser.blank?
+ self.depart=wxUser.depart
+ end
IMG_STORE_PATH = "shop"