This commit is contained in:
mkm 2024-01-10 10:43:39 +08:00
parent 3645c6deae
commit 455de45b0c

View File

@ -303,7 +303,7 @@ class Task extends CommonModel
}
$code= TaskStages::where('project_code',$projectCode)->where('name','进行中')->where('deleted',0)->value('code');
$data = [
$datas = [
'create_time' => nowTime(),
'code' => createUniqueCode('task'),
'create_by' => $memberCode,
@ -326,9 +326,9 @@ class Task extends CommonModel
'department_liaison' => $data['liasion_code'],
'status' => 2,
];
$result = self::create($data);
$result = self::create($datas);
// self::update(['sort' => $result['id']], ['id' => $result['id']]);
self::taskHook($memberCode, $data['code'], 'create');
self::taskHook($memberCode, $datas['code'], 'create');
if ($parentCode) {
self::taskHook($memberCode, $parentCode, 'createChild', '', '', 0, '', '', ['taskName' => trim($taskTitle)]);
}
@ -340,21 +340,20 @@ class Task extends CommonModel
$logType = 'claim';
}
// Task::taskHook($memberCode, $data['code'], $logType, $assignTo);
TaskMember::inviteMember($assignTo, $data['code'], 1, $isExecutor);
TaskMember::inviteMember($assignTo, $datas['code'], 1, $isExecutor);
}
if (!$assignTo || !$isExecutor) {
TaskMember::inviteMember($memberCode, $data['code'], 0, 1);
TaskMember::inviteMember($memberCode, $datas['code'], 0, 1);
}
if ($tagCodes) {
foreach ($tagCodes as $tagCode) {
TaskTag::setTag($tagCode, $data['code']);
TaskTag::setTag($tagCode, $datas['code']);
}
}
if(isset($data['file_list']) && $data['file_list']){
$file_list= explode(',',$data['file_list']);
$arr= File::whereIn('code',$file_list)->select();
foreach ($arr as $v){
\app\common\Model\SourceLink::createSource('file', $v['code'], 'task', $data['code']);
foreach ($file_list as $v){
\app\common\Model\SourceLink::createSource('file', $v, 'task', $datas['code']);
}
}
}