明树Git Lab

Commit b5cf3a4e authored by zfp1's avatar zfp1

1

parent b86ed16d
......@@ -696,8 +696,8 @@ async function getOwnProjects(req, res, next) {
search.raw = true;
console.log(search, "-==")
let ret = await DB.Project.findAndCountAll(search);
// let lastRet = await projectModule.handleProjectData(ret, search.attributes);
return res.sendData(ret);
let lastRet = await projectModule.handleProjectData(ret, search.attributes);
return res.sendData(lastRet);
} catch (error) {
next(error);
}
......
......@@ -16,11 +16,14 @@ const projectModule = require('../module/projectModule');
async function handleProjectData(ret, queryAttrs) {
let rawAttributes = DB.Project.rawAttributes;
console.log(rawAttributes, "====")
let queryRawAtr = [];
let queryRawAtr = [], resourceKeys = [];
for (let index = 0; index < queryAttrs.length; index++) {
const element = queryAttrs[index];
if(rawAttributes[element]) {
queryRawAtr.push(rawAttributes[element]);
if(['danxuan'].includes(element.zjType)) {
resourceKeys.push(element);
}
}
}
console.log(queryRawAtr);
......
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