fix: 防止重复更新消息和移除预计费用

This commit is contained in:
root
2026-03-01 13:45:44 +08:00
parent 34642bd008
commit b996ac21c0
@@ -688,6 +688,18 @@ class FeishuNotificationService
error_log("🔧 updateActorMessageCard 被调用: order_id={$orderId}, node_id={$nodeId}, actorUserId={$actorUserId}, status={$status}");
try {
// 检查是否已经更新过(防止重复更新)
$existingUpdate = \app\model\FeishuMessage::where('order_id', $orderId)
->where('node_id', $nodeId)
->where('user_id', $actorUserId)
->where('status', \app\model\FeishuMessage::STATUS_UPDATED)
->first();
if ($existingUpdate) {
error_log("⚠️ 操作人消息已被更新过,跳过重复更新: message_id={$existingUpdate->message_id}");
return true;
}
// 获取该操作人的消息
$message = \app\model\FeishuMessage::where('order_id', $orderId)
->where('node_id', $nodeId)
@@ -708,7 +720,7 @@ class FeishuNotificationService
return false;
}
error_log("🔍 准备更新操作人消息: message_id={$message->message_id}, company_id={$companyId}, feishu_app_id={$feishuAppId}");
error_log("🔍 准备更新操作人消息: message_id={$message->message_id}, company_id={$companyId}, feishu_app_id={$feishu_app_id}");
// 使用该消息对应的飞书应用配置
$this->companyId = $companyId;