let userList = await Dept.find({deptName:{$in:[‘行政部门’,‘财务部门’,]}})
let auditUsers = dept.username;
let curAuditUserName = dept.username
let auditFlows = [
{ userId:dept.userId,userName:dept.username,userEmail:dept.email }
]
userList.map(item => {
console.log(item.deptName)
auditFlows.push({
userId:item.userId,userName:item.username,userEmail:item.email
})
auditUsers += ','+item.username
})
这里虽然是无论怎么换都是行政部门的排列在后,为什么呢??会不会是跟mongoose查找速度有关系,这样很麻烦啊,没办法正确的排列审批流的顺序