|
@@ -10,7 +10,6 @@ class WxUser < ActiveRecord::Base
|
|
|
validates_presence_of :nickname, :unionid
|
|
validates_presence_of :nickname, :unionid
|
|
|
#belongs_to :channel_qrcode
|
|
#belongs_to :channel_qrcode
|
|
|
attr_accessor :invite, :v_head, :intro_user
|
|
attr_accessor :invite, :v_head, :intro_user
|
|
|
- after_update :after_update
|
|
|
|
|
|
|
|
|
|
SEX_ENUM= [["未知","0"], ["男性","1"], ["女性", "2"]]
|
|
SEX_ENUM= [["未知","0"], ["男性","1"], ["女性", "2"]]
|
|
|
RANK_ENUM= [["普通会员","0"], ["群主","1"], ["店长", "2"]]
|
|
RANK_ENUM= [["普通会员","0"], ["群主","1"], ["店长", "2"]]
|
|
@@ -21,22 +20,6 @@ class WxUser < ActiveRecord::Base
|
|
|
|
|
|
|
|
after_destroy :after_destroy
|
|
after_destroy :after_destroy
|
|
|
|
|
|
|
|
- def after_update
|
|
|
|
|
- test_redis = Redis.new(:host=>"r-wz9dtt12y12ns2b97gpd.redis.rds.aliyuncs.com",:db=>"0",:user=>"root",:password=>"Fohow123!@#")
|
|
|
|
|
- redis = Redis.new(:host=>"r-wz9dtt12y12ns2b97gpd.redis.rds.aliyuncs.com",:db=>"0",:user=>"root",:password=>"Fohow123!@#")
|
|
|
|
|
-
|
|
|
|
|
- #test_redis = Redis.new(url: "redis://root:8c!Beg9ocFag@r-wz9nmvnbdsek8yl476pd.redis.rds.aliyuncs.com:6379/102")
|
|
|
|
|
- #redis = Redis.new(url: "redis://root:8c!Beg9ocFag@r-wz9nmvnbdsek8yl476pd.redis.rds.aliyuncs.com:6379/15")
|
|
|
|
|
-
|
|
|
|
|
- userKey= format("userinfo_%d",self.id)
|
|
|
|
|
- redis.del(userKey)
|
|
|
|
|
- test_redis.del(userKey)
|
|
|
|
|
-
|
|
|
|
|
- wxuserKey= format("user_model.GetWxUserById:%d",self.id)
|
|
|
|
|
- redis.del(wxuserKey)
|
|
|
|
|
- test_redis.del(wxuserKey)
|
|
|
|
|
-
|
|
|
|
|
- end
|
|
|
|
|
|
|
|
|
|
def invite
|
|
def invite
|
|
|
wu = WxUser.where("id = ?", invite_id).first
|
|
wu = WxUser.where("id = ?", invite_id).first
|