Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
crm_uc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_server
crm_uc
Commits
6db47ed4
Commit
6db47ed4
authored
Mar 22, 2019
by
houdelin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change userable
parent
0c8d1102
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
app/models/concerns/crm_uc/organizationable.rb
+0
-0
app/models/concerns/crm_uc/userable.rb
+49
-0
No files found.
app/models/concerns/organizationable.rb
→
app/models/concerns/
crm_uc/
organizationable.rb
View file @
6db47ed4
File moved
app/models/concerns/crm_uc/userable.rb
View file @
6db47ed4
...
...
@@ -30,6 +30,55 @@ module CrmUc
where
(
status:
statuses
[
:visible
],
locked_at:
nil
)
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment