明树Git Lab

Commit 10030282 authored by zfp1's avatar zfp1

update

parent b3aa5ec5
Pipeline #109232 passed with stage
in 4 seconds
...@@ -67,8 +67,9 @@ async function getYyqtzhsInfo(req, res, next) { ...@@ -67,8 +67,9 @@ async function getYyqtzhsInfo(req, res, next) {
return res.sendError(errorMessage.resourceNotFound); return res.sendError(errorMessage.resourceNotFound);
} }
tzhs = tzhs.toJSON(); tzhs = tzhs.toJSON();
let lastyear = moment().subtract(1, 'year').format('YYYY'); let lastyear = moment(tzhs.nd).subtract(1, 'year').format('YYYY');
let lastyeartzhs = await DB.ThYyqtzhs.findOne({ where: { projectId: tzhs.projectId, nd: lastyear } }); console.log(lastyear, "=========")
let lastyeartzhs = await DB.ThYyqtzhs.findOne({ where: { projectId: tzhs.projectId, nd: sequelize.where(sequelize.fn('YEAR', sequelize.col('nd')), lastyear) } });
tzhs.lastyeartzhs = lastyeartzhs || null; tzhs.lastyeartzhs = lastyeartzhs || null;
// let yyqtzhss = await DB.ThYyqtzhszb.findAll({ where: { projectId: tzhs.projectId, sourceId: req.body.id }, raw: true }); // let yyqtzhss = await DB.ThYyqtzhszb.findAll({ where: { projectId: tzhs.projectId, sourceId: req.body.id }, raw: true });
// tzhs.yyqtzhss = _.values(_.groupBy(yyqtzhss, 'groupBy')) || [[]] // tzhs.yyqtzhss = _.values(_.groupBy(yyqtzhss, 'groupBy')) || [[]]
......
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