diff --git a/app/Models/Project.php b/app/Models/Project.php index 8ba298c51..1de538083 100644 --- a/app/Models/Project.php +++ b/app/Models/Project.php @@ -211,7 +211,7 @@ class Project extends AbstractModel 'important' => 1 ]); } - WebSocketDialogUser::whereDialogId($this->dialog_id)->whereNotIn('userid', $userids)->whereImportant(1)->delete(); + WebSocketDialogUser::whereDialogId($this->dialog_id)->whereNotIn('userid', $userids)->whereImportant(1)->remove(); }); } @@ -252,7 +252,7 @@ class Project extends AbstractModel $this->archived_userid = User::userid(); $this->addLog("项目取消归档"); $this->pushMsg('recovery', $this); - ProjectTask::whereProjectId($this->id)->whereArchivedFollow(1)->update([ + ProjectTask::whereProjectId($this->id)->whereArchivedFollow(1)->modify([ 'archived_at' => null, 'archived_follow' => 0 ]); @@ -262,7 +262,7 @@ class Project extends AbstractModel $this->archived_userid = User::userid(); $this->addLog("项目归档"); $this->pushMsg('archived'); - ProjectTask::whereProjectId($this->id)->whereArchivedAt(null)->update([ + ProjectTask::whereProjectId($this->id)->whereArchivedAt(null)->modify([ 'archived_at' => $archived_at, 'archived_follow' => 1 ]); diff --git a/app/Models/ProjectTask.php b/app/Models/ProjectTask.php index 73ae872cb..7856ac87e 100644 --- a/app/Models/ProjectTask.php +++ b/app/Models/ProjectTask.php @@ -1047,7 +1047,7 @@ class ProjectTask extends AbstractModel 'important' => 1 ]); } - WebSocketDialogUser::whereDialogId($this->dialog_id)->whereNotIn('userid', $userids)->whereImportant(1)->delete(); + WebSocketDialogUser::whereDialogId($this->dialog_id)->whereNotIn('userid', $userids)->whereImportant(1)->remove(); }); } @@ -1265,7 +1265,7 @@ class ProjectTask extends AbstractModel 'archived_at' => $this->archived_at, 'archived_userid' => $this->archived_userid, ]); - self::whereParentId($this->id)->update([ + self::whereParentId($this->id)->modify([ 'archived_at' => $this->archived_at, 'archived_userid' => $this->archived_userid, 'archived_follow' => $this->archived_follow, @@ -1287,7 +1287,7 @@ class ProjectTask extends AbstractModel $dialog = WebSocketDialog::find($this->dialog_id); $dialog?->deleteDialog(); } - self::whereParentId($this->id)->delete(); + self::whereParentId($this->id)->remove(); $this->deleted_userid = User::userid(); $this->save(); $this->addLog("删除{任务}"); diff --git a/database/migrations/2021_12_13_002344_project_tasks_add_archived_follow.php b/database/migrations/2021_12_13_002344_project_tasks_add_archived_follow.php index da29c2fa4..692cb4241 100644 --- a/database/migrations/2021_12_13_002344_project_tasks_add_archived_follow.php +++ b/database/migrations/2021_12_13_002344_project_tasks_add_archived_follow.php @@ -27,7 +27,7 @@ class ProjectTasksAddArchivedFollow extends Migration // 更新数据 Project::whereNotNull('archived_at')->chunkById(100, function ($lists) { foreach ($lists as $item) { - ProjectTask::whereProjectId($item->id)->whereArchivedAt(null)->update([ + ProjectTask::whereProjectId($item->id)->whereArchivedAt(null)->modify([ 'archived_at' => $item->archived_at, 'archived_follow' => 1 ]); diff --git a/database/migrations/2022_01_06_164034_project_tasks_update_subtask_archived_delete.php b/database/migrations/2022_01_06_164034_project_tasks_update_subtask_archived_delete.php index 7261f3841..ab8f63a17 100644 --- a/database/migrations/2022_01_06_164034_project_tasks_update_subtask_archived_delete.php +++ b/database/migrations/2022_01_06_164034_project_tasks_update_subtask_archived_delete.php @@ -18,7 +18,7 @@ class ProjectTasksUpdateSubtaskArchivedDelete extends Migration ->chunkById(100, function ($lists) { /** @var ProjectTask $task */ foreach ($lists as $task) { - ProjectTask::whereParentId($task->id)->update([ + ProjectTask::whereParentId($task->id)->modify([ 'archived_at' => $task->archived_at, 'archived_userid' => $task->archived_userid, 'archived_follow' => $task->archived_follow,