perf: 记录任务工作流变化

This commit is contained in:
kuaifan
2022-02-27 14:12:15 +08:00
parent e3b7ac00fd
commit 611c6d415c
3 changed files with 81 additions and 0 deletions

View File

@@ -585,6 +585,14 @@ class ProjectTask extends AbstractModel
'flow' => $flowData,
'change' => [$currentFlowItem?->name, $newFlowItem->name]
]);
ProjectTaskFlowChange::createInstance([
'task_id' => $this->id,
'userid' => User::userid(),
'before_flow_item_id' => $flowData['flow_item_id'],
'before_flow_item_name' => $flowData['flow_item_name'],
'after_flow_item_id' => $this->flow_item_id,
'after_flow_item_name' => $this->flow_item_name,
])->save();
}
// 状态
if (Arr::exists($data, 'complete_at')) {