Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
ts-api-demo
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wmvm
ts-api-demo
Commits
b85ea206
Commit
b85ea206
authored
Sep 18, 2024
by
ml
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实名列表逻辑调整
parent
3d6790b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
29 deletions
+53
-29
mUserRealName.service.ts
src/functional/mvc/service/mUserRealName.service.ts
+53
-29
No files found.
src/functional/mvc/service/mUserRealName.service.ts
View file @
b85ea206
...
@@ -41,6 +41,8 @@ export interface QueryVO {
...
@@ -41,6 +41,8 @@ export interface QueryVO {
from_time
?:
Date
|
any
from_time
?:
Date
|
any
to_time
?:
Date
|
any
to_time
?:
Date
|
any
condition
?:
string
}
}
export
async
function
getRealNameByUserId
(
user_id
:
number
|
any
)
{
export
async
function
getRealNameByUserId
(
user_id
:
number
|
any
)
{
...
@@ -70,28 +72,49 @@ export async function getRealNameMapByUserIds(userIds: number[]) {
...
@@ -70,28 +72,49 @@ export async function getRealNameMapByUserIds(userIds: number[]) {
export
async
function
kycList
(
queryVO
:
QueryVO
)
{
export
async
function
kycList
(
queryVO
:
QueryVO
)
{
let
where
=
{}
let
condition
=
queryVO
.
condition
;
if
(
queryVO
.
user_id
)
{
let
uids
:
any
=
[];
//uid 是否在受限范围内
let
userMap
=
{};
if
(
isLimitUserId
(
queryVO
.
user_id
))
{
if
(
condition
)
{
throw
ErrorCode
.
UID_LIMIT
let
orCondition
=
{
email
:
String
(
condition
),
real_name
:
String
(
condition
),
phone
:
String
(
condition
),
identity
:
String
(
condition
),
};
if
(
!
isNaN
(
Number
(
condition
)))
{
orCondition
[
'user_id'
]
=
Number
(
condition
)
}
}
where
[
"user_id"
]
=
queryVO
.
user_id
;
}
let
dbUserList
=
await
userInfo
.
prototype
.
findAll
({
else
{
attributes
:
[
'user_id'
,
'email'
,
'phone'
],
if
(
UID_MIN
&&
UID_LIMIT
.
length
)
{
where
:
{
[
ormDB
.
Op
.
or
]:
orCondition
},
where
[
ormDB
.
Op
.
and
]
=
[{
raw
:
true
user_id
:
{
[
ormDB
.
Op
.
gte
]:
UID_MIN
}
});
},
if
(
!
dbUserList
.
length
)
{
{
return
{
user_id
:
{
[
ormDB
.
Op
.
notIn
]:
UID_LIMIT
},
count
:
0
,
}]
rows
:
[]
}
}
}
else
{
for
(
let
one
of
dbUserList
)
{
where
[
"user_id"
]
=
{
[
ormDB
.
Op
.
gte
]:
UID_MIN
}
uids
.
push
(
one
.
user_id
)
userMap
[
one
.
user_id
]
=
one
.
email
;
}
}
let
where
=
{}
if
(
uids
.
length
)
{
where
[
'user_id'
]
=
{
[
ormDB
.
Op
.
in
]:
uids
}
}
if
(
condition
&&
!
isNaN
(
Number
(
condition
)))
{
where
[
ormDB
.
Op
.
or
]
=
{
user_id
:
Number
(
condition
),
identity
:
condition
}
}
}
}
if
(
!
isNaN
(
Number
(
queryVO
.
status
))
)
{
if
(
queryVO
.
status
||
queryVO
.
status
===
0
)
{
where
[
"status"
]
=
queryVO
.
status
where
[
"status"
]
=
queryVO
.
status
}
}
if
(
queryVO
.
source
)
{
if
(
queryVO
.
source
)
{
...
@@ -129,17 +152,18 @@ export async function kycList(queryVO: QueryVO) {
...
@@ -129,17 +152,18 @@ export async function kycList(queryVO: QueryVO) {
});
});
if
(
resList
.
rows
.
length
)
{
if
(
resList
.
rows
.
length
)
{
let
uids
=
resList
.
rows
.
map
(
item
=>
item
.
user_id
);
if
(
!
uids
.
length
)
{
let
userMap
=
{};
uids
=
resList
.
rows
.
map
(
item
=>
item
.
user_id
);
let
dbUserInfos
=
await
userInfo
.
prototype
.
findAll
({
let
dbUserInfos
=
await
userInfo
.
prototype
.
findAll
({
attributes
:
[
'user_id'
,
'email'
],
attributes
:
[
'user_id'
,
'email'
],
where
:
{
where
:
{
user_id
:
{
[
ormDB
.
Op
.
in
]:
uids
}
user_id
:
{
[
ormDB
.
Op
.
in
]:
uids
}
},
},
raw
:
true
raw
:
true
});
});
for
(
let
dbUserInfo
of
dbUserInfos
)
{
for
(
let
dbUserInfo
of
dbUserInfos
)
{
userMap
[
dbUserInfo
.
user_id
]
=
dbUserInfo
.
email
;
userMap
[
dbUserInfo
.
user_id
]
=
dbUserInfo
.
email
;
}
}
}
for
(
let
item
of
resList
.
rows
)
{
for
(
let
item
of
resList
.
rows
)
{
item
.
email
=
userMap
[
item
.
user_id
]
?
userMap
[
item
.
user_id
]
:
""
item
.
email
=
userMap
[
item
.
user_id
]
?
userMap
[
item
.
user_id
]
:
""
...
...
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