Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yizhi_server
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
data_server
yizhi_server
Commits
459d00cf
Commit
459d00cf
authored
Jun 19, 2019
by
姜登
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user
parent
b0b840e8
Pipeline
#9122
passed with stage
in 5 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
user.js
app/controller/user.js
+4
-5
No files found.
app/controller/user.js
View file @
459d00cf
...
@@ -47,12 +47,8 @@ class UserController extends Controller {
...
@@ -47,12 +47,8 @@ class UserController extends Controller {
const
{
ctx
,
service
}
=
this
;
const
{
ctx
,
service
}
=
this
;
const
Op
=
ctx
.
app
.
Sequelize
.
Op
;
const
Op
=
ctx
.
app
.
Sequelize
.
Op
;
ctx
.
validate
(
this
.
indexRule
,
ctx
.
query
);
ctx
.
validate
(
this
.
indexRule
,
ctx
.
query
);
const
{
type
}
=
ctx
.
query
;
const
user
=
await
service
.
user
.
getUserInfo
();
const
user
=
await
service
.
user
.
getUserInfo
();
const
where
=
{};
const
where
=
{};
if
(
type
!==
'all'
)
{
where
.
dd_id
=
user
.
id
;
where
.
dd_name
=
user
.
name
;
Object
.
keys
(
ctx
.
query
).
forEach
(
key
=>
{
Object
.
keys
(
ctx
.
query
).
forEach
(
key
=>
{
if
(
ctx
.
query
[
key
]
&&
this
.
indexRule
.
hasOwnProperty
(
key
))
{
if
(
ctx
.
query
[
key
]
&&
this
.
indexRule
.
hasOwnProperty
(
key
))
{
if
(
key
===
'status'
)
{
if
(
key
===
'status'
)
{
...
@@ -64,9 +60,12 @@ class UserController extends Controller {
...
@@ -64,9 +60,12 @@ class UserController extends Controller {
}
}
}
}
});
});
if
(
user
.
department
[
0
].
name
===
'战略合作组'
||
user
.
department
[
0
].
name
===
'数据项目组'
)
{
where
.
dd_id
=
user
.
department
[
0
].
id
;
where
.
dd_name
=
user
.
name
;
}
}
const
accountData
=
await
service
.
user
.
fetchAccount
(
where
,
ctx
.
pagination
);
const
accountData
=
await
service
.
user
.
fetchAccount
(
where
,
ctx
.
pagination
);
const
total
=
await
service
.
user
.
count
(
{
dd_id
:
user
.
id
,
dd_name
:
user
.
name
,
...
where
}
);
const
total
=
await
service
.
user
.
count
(
where
);
ctx
.
success
({
data
:
accountData
,
total
,
...
ctx
.
pagination
});
ctx
.
success
({
data
:
accountData
,
total
,
...
ctx
.
pagination
});
}
}
...
...
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