|
@@ -79,8 +79,9 @@ module.exports = app => {
|
|
|
if (folderInfo.parent_path) {
|
|
|
const parentFolderIds = folderInfo.parent_path.split('-');
|
|
|
for (const pf of parentFolderIds) {
|
|
|
+ const pfInfo = await this.ctx.service.paymentFolder.getDataByCondition({ spid: this.ctx.subProject.id, folder_id: parseInt(pf) });
|
|
|
updateData.push({
|
|
|
- id: parseInt(pf),
|
|
|
+ id: pfInfo.id,
|
|
|
had_tender: 1,
|
|
|
});
|
|
|
}
|
|
@@ -124,10 +125,11 @@ module.exports = app => {
|
|
|
const parentFolderIds = folderInfo.parent_path.split('-').reverse();
|
|
|
for (const pfid of parentFolderIds) {
|
|
|
const parentFolderId = parseInt(pfid);
|
|
|
- const leafFolderCount = await transaction.count(this.ctx.service.paymentFolder.tableName, { parent_id: parentFolderId, had_tender: 1 });
|
|
|
+ const leafFolderCount = await transaction.count(this.ctx.service.paymentFolder.tableName, { spid: this.ctx.subProject.id, parent_id: parentFolderId, had_tender: 1 });
|
|
|
if (leafFolderCount === 1) {
|
|
|
+ const pfInfo = await this.ctx.service.paymentFolder.getDataByCondition({ spid: this.ctx.subProject.id, folder_id: parseInt(parentFolderId) });
|
|
|
updateDatas.push({
|
|
|
- id: parentFolderId,
|
|
|
+ id: pfInfo.id,
|
|
|
had_tender: 0,
|
|
|
});
|
|
|
} else {
|