mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-07 05:13:11 +00:00
feat: 修复移动任务中选完成进行移动没有设置完成时间的bug
This commit is contained in:
parent
2bd8199d88
commit
d7d8ee481e
@ -1717,41 +1717,48 @@ class ProjectTask extends AbstractModel
|
|||||||
*/
|
*/
|
||||||
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 = [])
|
||||||
{
|
{
|
||||||
AbstractModel::transaction(function () use($projectId, $columnId, $flowItemId, $owner, $assist) {
|
AbstractModel::transaction(function () use ($projectId, $columnId, $flowItemId, $owner, $assist) {
|
||||||
$newTaskUser = array_merge($owner, $assist);
|
$newTaskUser = array_merge($owner, $assist);
|
||||||
//
|
//
|
||||||
$this->project_id = $projectId;
|
$this->project_id = $projectId;
|
||||||
$this->column_id = $columnId;
|
$this->column_id = $columnId;
|
||||||
$this->flow_item_id = $flowItemId;
|
|
||||||
// 任务内容
|
// 任务内容
|
||||||
if($this->content){
|
if ($this->content) {
|
||||||
$this->content->project_id = $projectId;
|
$this->content->project_id = $projectId;
|
||||||
$this->content->save();
|
$this->content->save();
|
||||||
}
|
}
|
||||||
// 任务文件
|
// 任务文件
|
||||||
foreach ($this->taskFile as $taskFile){
|
foreach ($this->taskFile as $taskFile) {
|
||||||
$taskFile->project_id = $projectId;
|
$taskFile->project_id = $projectId;
|
||||||
$taskFile->save();
|
$taskFile->save();
|
||||||
}
|
}
|
||||||
// 任务标签
|
// 任务标签
|
||||||
foreach ($this->taskTag as $taskTag){
|
foreach ($this->taskTag as $taskTag) {
|
||||||
$taskTag->project_id = $projectId;
|
$taskTag->project_id = $projectId;
|
||||||
$taskTag->save();
|
$taskTag->save();
|
||||||
}
|
}
|
||||||
// 任务用户
|
// 任务用户
|
||||||
$this->updateTask(['owner' => $owner]);
|
$this->updateTask([
|
||||||
$this->updateTask(['assist' => $assist]);
|
'owner' => $owner,
|
||||||
foreach ($this->taskUser as $taskUser){
|
'assist' => $assist
|
||||||
if( in_array($taskUser->id, $newTaskUser) ){
|
]);
|
||||||
|
foreach ($this->taskUser as $taskUser) {
|
||||||
|
if (in_array($taskUser->id, $newTaskUser)) {
|
||||||
$taskUser->project_id = $projectId;
|
$taskUser->project_id = $projectId;
|
||||||
$taskUser->save();
|
$taskUser->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
if($flowItemId){
|
if ($flowItemId) {
|
||||||
$flowItem = projectFlowItem::whereProjectId($projectId)->whereId($flowItemId)->first();
|
$flowItem = projectFlowItem::whereProjectId($projectId)->whereId($flowItemId)->first();
|
||||||
|
$this->flow_item_id = $flowItemId;
|
||||||
$this->flow_item_name = $flowItem->status . "|" . $flowItem->name;
|
$this->flow_item_name = $flowItem->status . "|" . $flowItem->name;
|
||||||
}else{
|
if ($flowItem->status == 'end') {
|
||||||
|
$this->completeTask(Carbon::now(), $flowItem->name);
|
||||||
|
} else {
|
||||||
|
$this->completeTask(null);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
$this->flow_item_name = '';
|
$this->flow_item_name = '';
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user