|
@@ -584,11 +584,11 @@ module.exports = app => {
|
|
|
await transaction.delete(this.ctx.service.stageOther.tableName, { sid: id });
|
|
|
// 同步删除进度里所选的期
|
|
|
await transaction.delete(this.ctx.service.scheduleStage.tableName, { tid: stageInfo.tid, order: stageInfo.order });
|
|
|
- const detailAtt = await this.ctx.service.stageDetailAtt.getStageData(id);
|
|
|
+ const detailAtt = await this.ctx.service.stageDetailAtt.getAllDataByCondition({ where: { sid: id } });
|
|
|
if (detailAtt && detailAtt.length > 0) {
|
|
|
for (const da of detailAtt) {
|
|
|
+ da.attachment = da.attachment ? JSON.parse(da.attachment) : [];
|
|
|
for (const daa of da.attachment) {
|
|
|
- console.log(daa);
|
|
|
if (fs.existsSync(path.join(this.app.baseDir, daa.filepath))) {
|
|
|
await fs.unlinkSync(path.join(this.app.baseDir, daa.filepath));
|
|
|
}
|