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
5c7e385f
Commit
5c7e385f
authored
Jun 03, 2020
by
姜登
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd_name
parent
f7bf4286
Pipeline
#24325
passed with stage
in 1 minute 16 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
5 deletions
+55
-5
user.js
app/controller/user.js
+5
-5
ddname.js
app/model/yizhi/ddname.js
+50
-0
No files found.
app/controller/user.js
View file @
5c7e385f
...
...
@@ -70,11 +70,11 @@ class UserController extends Controller {
}
}
});
if
(
user
.
department
[
0
].
name
===
'战略合作组'
||
user
.
department
[
0
].
name
===
'数据项目组'
)
{
if
(
user
.
name
!==
'颜笑笑'
&&
user
.
name
!==
'汤晓丹'
&&
user
.
name
!==
'宇文瑞娟'
)
{
where
.
dd_id
=
user
.
department
[
0
].
id
;
where
.
dd_name
=
user
.
name
;
}
const
limitUser
=
await
service
.
user
.
findOne
(
'DdName'
,
{
name
:
user
.
name
},
[
'name'
]);
if
(
limitUser
&&
limitUser
.
name
)
{
// if (user.name !== '颜笑笑' && user.name !== '汤晓丹' && user.name !== '宇文瑞娟') {
// where.dd_id = user.department[0].id
;
where
.
dd_name
=
user
.
name
;
}
const
accountData
=
await
service
.
user
.
fetchAccount
(
where
,
ctx
.
pagination
);
const
total
=
await
service
.
user
.
count
(
where
);
...
...
app/model/yizhi/ddname.js
0 → 100644
View file @
5c7e385f
'use strict'
;
const
moment
=
require
(
'moment'
);
module
.
exports
=
app
=>
{
const
{
DataTypes
}
=
app
.
Sequelize
;
const
ddname
=
app
.
yizhiModel
.
define
(
'dd_name'
,
{
id
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
primaryKey
:
true
,
autoIncrement
:
true
,
},
name
:
{
type
:
DataTypes
.
STRING
(
20
),
allowNull
:
true
,
field
:
'name'
,
},
dd_id
:
{
type
:
DataTypes
.
STRING
(
20
),
allowNull
:
true
,
field
:
'dd_id'
,
},
status
:
{
type
:
DataTypes
.
INTEGER
(
1
),
allowNull
:
false
,
defaultValue
:
1
,
field
:
'status'
,
},
created_at
:
{
type
:
DataTypes
.
DATE
,
get
()
{
const
date
=
this
.
getDataValue
(
'created_at'
);
return
date
?
moment
(
date
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
undefined
;
},
field
:
'created_at'
,
},
updated_at
:
{
type
:
DataTypes
.
DATE
,
get
()
{
const
date
=
this
.
getDataValue
(
'updated_at'
);
return
date
?
moment
(
date
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
undefined
;
},
field
:
'updated_at'
,
},
},
{
tableName
:
'dd_name'
,
});
return
ddname
;
};
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