From 9d37048d496165fd8031daf63da07324f0b849c4 Mon Sep 17 00:00:00 2001 From: mzl Date: Fri, 5 Sep 2025 16:55:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=82=AE=E4=BB=B6=E8=AF=A2?= =?UTF-8?q?=E7=9B=98=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/utils/email/Emails.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/common/utils/email/Emails.php b/app/common/utils/email/Emails.php index 68aca42..e910504 100644 --- a/app/common/utils/email/Emails.php +++ b/app/common/utils/email/Emails.php @@ -431,12 +431,12 @@ class Emails $enterUser = User::where('id', $enterUserId)->first(); // 固定渠道 - $channel = 8; + $channel = 12; $channelInfo = InquiryChannel::where('id', $channel)->first(); // 初始化 UID 轮询器 $uidRotator = new \app\common\utils\RedisUidRotator('email_parsed_result_20250804'); - $uidRotator->setUids([64, 63, 83, 93, 108, 118, 132, 145, 150, 143, 156, 157, 158], false); + $uidRotator->setUids([64, 63, 83, 93, 108, 132, 145, 150, 143, 156, 157, 158], false); EmailParsedResult::where('status', 0) ->chunkById($batchSize, function ($records) use ($delaySeconds, $throttleAfter, $throttleSeconds, $enterUser, $channelInfo, $uidRotator) { @@ -452,7 +452,13 @@ class Emails $assignedUid = $uidRotator->next(); // 获取分配的用户信息 - $recipientInfo = User::where('id', $assignedUid)->first(); + $recipientInfo = User::where('id', $assignedUid)->where('status', 1)->first(); + if (!$recipientInfo) { + flg("用户ID=" . $assignedUid . " 不存在或已离职跳过分配,需要手动移除 UID"); + + $assignedUid = $uidRotator->next(); + $recipientInfo = User::where('id', $assignedUid)->where('status', 1)->first(); + } // 生成录单 $log = [