|
|
@ -3,14 +3,19 @@ const fs = require('fs'); |
|
|
|
const moment = require('moment'); |
|
|
|
/** |
|
|
|
* 查询员工沟通统计数据 |
|
|
|
* @param {*} ctx ctx ctx.query:{keywordTarget-关键字项、keyword-关键字内容、limit-页宽, page-页码} |
|
|
|
* @param {*} ctx ctx ctx.query:{keywordTarget-关键字项、keyword-关键字内容、timeRange-沟通时间、limit-页宽, page-页码} |
|
|
|
*/ |
|
|
|
async function get(ctx) { |
|
|
|
try { |
|
|
|
const { models } = ctx.fs.dc; |
|
|
|
const { keywordTarget, keyword, entryTime, limit, page } = ctx.query; |
|
|
|
const { keywordTarget, keyword, timeRange, limit, page } = ctx.query; |
|
|
|
const where = {}; |
|
|
|
|
|
|
|
if (keywordTarget && keyword) { |
|
|
|
where[keywordTarget] = { $iLike: `%${keyword}%` }; |
|
|
|
} |
|
|
|
if(timeRange){ |
|
|
|
where.communicateDate= { $between: timeRange.split(',') }; |
|
|
|
} |
|
|
|
let employeeCommunicate = await models.EmployeeCommunicate.findAndCountAll({ |
|
|
|
where: where, |
|
|
|
offset: Number(page) * Number(limit), |
|
|
|