fix: 如果项目没有流程,无法选择移动后的状态,也没办法确定移动

This commit is contained in:
weifs
2024-06-03 11:13:01 +08:00
parent 79065a7675
commit 008040d96c
3 changed files with 25 additions and 11 deletions

View File

@@ -1721,9 +1721,9 @@ class ProjectTask extends AbstractModel
* @param array $assist
* @return bool
*/
public function moveTask(int $projectId, int $columnId,int $flowItemId = 0,array $owner = [], array $assist = [])
public function moveTask(int $projectId, int $columnId,int $flowItemId = 0,array $owner = [], array $assist = [], string $completeAt='')
{
AbstractModel::transaction(function () use ($projectId, $columnId, $flowItemId, $owner, $assist) {
AbstractModel::transaction(function () use ($projectId, $columnId, $flowItemId, $owner, $assist, $completeAt) {
$newTaskUser = array_merge($owner, $assist);
//
$this->project_id = $projectId;
@@ -1765,9 +1765,14 @@ class ProjectTask extends AbstractModel
$this->completeTask(null);
}
} else {
$this->flow_item_id = 0;
$this->flow_item_name = '';
}
//
if ($completeAt) {
$this->complete_at = $completeAt;
}
//
$this->save();
//
$this->addLog("移动{任务}");