zmh
2 years ago
2 changed files with 40 additions and 0 deletions
@ -0,0 +1,31 @@ |
|||||
|
'use strict'; |
||||
|
const fs = require('fs'); |
||||
|
const moment = require('moment'); |
||||
|
/** |
||||
|
* 查询员工沟通统计数据 |
||||
|
* @param {*} ctx ctx ctx.query:{keywordTarget-关键字项、keyword-关键字内容、limit-页宽, page-页码} |
||||
|
*/ |
||||
|
async function get(ctx) { |
||||
|
try { |
||||
|
const { models } = ctx.fs.dc; |
||||
|
const { keywordTarget, keyword, entryTime, limit, page } = ctx.query; |
||||
|
const where = {}; |
||||
|
|
||||
|
let employeeCommunicate = await models.EmployeeCommunicate.findAndCountAll({ |
||||
|
where: where, |
||||
|
offset: Number(page) * Number(limit), |
||||
|
limit: Number(limit), |
||||
|
order: [['id', 'ASC']] |
||||
|
}); |
||||
|
ctx.status = 200 |
||||
|
ctx.body = employeeCommunicate; |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path:${ctx.path},error:${error}`) |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { name: 'FindError', message: '查询员工沟通统计数据失败' } |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
module.exports = { |
||||
|
get |
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
const employeeCommunicate = require('../../controllers/employeeCommunicate'); |
||||
|
|
||||
|
module.exports = function (app, router, opts) { |
||||
|
|
||||
|
app.fs.api.logAttr['GET/employee/communicate/list'] = { content: '查询员工沟通统计数据', visible: true }; |
||||
|
router.get('/employee/communicate/list', employeeCommunicate.get); |
||||
|
}; |
Loading…
Reference in new issue