|
|
@@ -220,7 +220,7 @@ module.exports = app => {
|
|
|
const delData = posterity.map(x => {return { id: x.id, is_deleted: 1 }; });
|
|
|
delData.push({ id: data.id, is_deleted: 1});
|
|
|
|
|
|
- const sibling = await this.getAllDataByCondition({ where: { tree_pid: filing.tree_pid } });
|
|
|
+ const sibling = await this.getAllDataByCondition({ where: { tree_pid: filing.tree_pid, spid: delData.spid, is_deleted: 0 } });
|
|
|
const updateData = [];
|
|
|
sibling.forEach(x => {
|
|
|
if (x.tree_order > filing.tree_order) updateData.push({ id: x.id, tree_order: x.tree_order - 1});
|
|
|
@@ -267,7 +267,7 @@ module.exports = app => {
|
|
|
});
|
|
|
}
|
|
|
} else {
|
|
|
- const orgSibling = await this.getAllDataByCondition({ where: { tree_pid: filing.tree_pid, is_deleted: 0 } });
|
|
|
+ const orgSibling = await this.getAllDataByCondition({ where: { spid: filing.spid, tree_pid: filing.tree_pid, is_deleted: 0 } });
|
|
|
orgSibling.forEach(x => {
|
|
|
if (x.id === filing.id) return;
|
|
|
if (x.tree_order < filing.tree_order) return;
|