diff --git a/app/Tasks/BotReceiveMsgTask.php b/app/Tasks/BotReceiveMsgTask.php index 8f71c5923..e5fe2ca93 100644 --- a/app/Tasks/BotReceiveMsgTask.php +++ b/app/Tasks/BotReceiveMsgTask.php @@ -621,6 +621,24 @@ private function AIGenerateSystemMessageOrBeforeText(int|null $userid, WebSocket EOF; } } + $subTask = ProjectTask::select(['id', 'name', 'complete_at', 'end_at'])->whereParentId($taskInfo->id)->get(); + if ($subTask->isNotEmpty()) { + $subTaskContent = $subTask->map(function($item) { + $status = ""; + if ($item->complete_at) { + $status = " (已完成)"; + } elseif ($item->end_at && Carbon::parse($item->end_at)->lt(Carbon::now())) { + $status = " (已过期)"; + } + return " - {$item->name} {$status}"; + })->join("\n"); + if ($subTaskContent) { + $before_text[] = <<