fix: 防止重复更新消息和移除预计费用
This commit is contained in:
@@ -688,6 +688,18 @@ class FeishuNotificationService
|
|||||||
error_log("🔧 updateActorMessageCard 被调用: order_id={$orderId}, node_id={$nodeId}, actorUserId={$actorUserId}, status={$status}");
|
error_log("🔧 updateActorMessageCard 被调用: order_id={$orderId}, node_id={$nodeId}, actorUserId={$actorUserId}, status={$status}");
|
||||||
|
|
||||||
try {
|
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)
|
$message = \app\model\FeishuMessage::where('order_id', $orderId)
|
||||||
->where('node_id', $nodeId)
|
->where('node_id', $nodeId)
|
||||||
@@ -708,7 +720,7 @@ class FeishuNotificationService
|
|||||||
return false;
|
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;
|
$this->companyId = $companyId;
|
||||||
|
|||||||
Reference in New Issue
Block a user