Commit 5c7e385f authored by 姜登's avatar 姜登

dd_name

parent f7bf4286
Pipeline #24325 passed with stage
in 1 minute 16 seconds
......@@ -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);
......
'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;
};
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