fix: 修复 BusinessTripService 中未定义变量 $node 的问题

- 将 $node 作为参数传递给 sendApprovalNotification() 方法
- 修复消息发送时 'Undefined variable $node' 错误
This commit is contained in:
root
2026-03-01 09:03:24 +08:00
parent 32719406a3
commit 7efd525f49
+2 -2
View File
@@ -269,7 +269,7 @@ class BusinessTripService
// 发送飞书通知给审批人
error_log("🔔 准备发送审批通知,调用 sendApprovalNotification 方法");
error_log("📋 传递的参数 - approverIds: " . json_encode($approverIds) . ", ccUserIds: " . json_encode($ccUserIds));
$this->sendApprovalNotification($businessTrip, $approverIds, $ccUserIds);
$this->sendApprovalNotification($businessTrip, $approverIds, $ccUserIds, $node);
return $businessTrip->fresh(['itineraries', 'approvalOrder']);
});
@@ -278,7 +278,7 @@ class BusinessTripService
/**
* 发送审批通知(飞书消息)
*/
private function sendApprovalNotification(BusinessTrip $businessTrip, array $approverIds, array $ccUserIds): void
private function sendApprovalNotification(BusinessTrip $businessTrip, array $approverIds, array $ccUserIds, ApprovalNode $node): void
{
try {
error_log("🔔 准备发送审批通知: trip_id={$businessTrip->id}, approvers=" . json_encode($approverIds) . ", cc=" . json_encode($ccUserIds));