Commit 6db47ed4 by houdelin

change userable

parent 0c8d1102
...@@ -30,6 +30,55 @@ module CrmUc ...@@ -30,6 +30,55 @@ module CrmUc
where(status: statuses[:visible], locked_at: nil) where(status: statuses[:visible], locked_at: nil)
end end
} }
end
if AppSettings.wxwork?
def phone
self.attributes["phone"].gsub(/^lxjxc/, "") if self.attributes["phone"]
end
def email
self.attributes["email"].gsub(/^lxjxc/, "") if self.attributes["email"]
end
end
def parent
return if superior_id.blank?
self.class.stateless.find_by(id: superior_id)
end
def locked_at
if AppSettings.uc_enabled?
usable? ? nil : Time.now
else
self.attributes['locked_at']
end
end
def ikcrm_user?
AppSettings.ikcrm?
end
def wx_userid
get_wx_userid_key = "#{uid}_to_wx_userid"
$redis.set(get_wx_userid_key, UserCenter::Services::Wx::TransferIdServices.get_wx_userid_by_uid(organization.oid, uid), ex: 7.days) if $redis.get(get_wx_userid_key).blank?
$redis.get(get_wx_userid_key)
end
def userid
if AppSettings.wxwork?
wx_userid
elsif AppSettings.dingtalk?
# TODO
ding_user.userid
end
end
def to_s
name || email
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment