perf: 审批和任务通知优化

This commit is contained in:
weifs
2024-04-25 11:24:30 +08:00
parent 30676fb761
commit 693fa46688
4 changed files with 31 additions and 3 deletions

View File

@@ -1667,7 +1667,9 @@ class ProjectTask extends AbstractModel
if (empty($receivers)) {
return;
}
//
$userid = User::userid();
//
$botUser = User::botGetOrCreate('task-alert');
if (empty($botUser)) {
return;
@@ -1699,7 +1701,7 @@ class ProjectTask extends AbstractModel
ProjectTaskPushLog::createInstance($data)->save();
WebSocketDialogMsg::sendMsg(null, $dialog->id, 'text', [
'text' => str_replace("您的任务", $replace, $text) . $suffix
], $botUser->userid);
], in_array($type, [0, 3]) ? $userid : $botUser->userid);
}
}
}