fix: 主任务被删除或归档时子任务应该也同步

This commit is contained in:
kuaifan
2022-01-06 16:51:32 +08:00
parent c930e4dd92
commit 24287c0857
3 changed files with 60 additions and 5 deletions

View File

@@ -799,6 +799,11 @@ class ProjectTask extends AbstractModel
$this->addLog($logText, $userid);
$this->pushMsg('archived');
}
self::whereParentId($this->id)->update([
'archived_at' => $this->archived_at,
'archived_userid' => $this->archived_userid,
'archived_follow' => $this->archived_follow,
]);
$this->save();
});
return true;
@@ -814,12 +819,11 @@ class ProjectTask extends AbstractModel
AbstractModel::transaction(function () {
if ($this->dialog_id) {
$dialog = WebSocketDialog::find($this->dialog_id);
if ($dialog) {
$dialog->deleteDialog();
}
$dialog?->deleteDialog();
}
$this->delete();
self::whereParentId($this->id)->delete();
$this->addLog("删除{任务}" . $this->name);
$this->delete();
});
if ($pushMsg) {
$this->pushMsg('delete');