修改询盘自动配置

This commit is contained in:
mzl
2026-01-22 10:15:05 +08:00
parent 607de6c70a
commit 733996f346
2 changed files with 17 additions and 16 deletions
+11 -2
View File
@@ -2,6 +2,8 @@
namespace app\process;
use app\common\model\UserGroup;
use app\common\model\UserGroupMembers;
use app\inquiry\service\FbFileImportService;
use app\inquiry\service\FbLeadSyncService;
use app\inquiry\service\InquiryAssignService;
@@ -55,11 +57,18 @@ class InquiryAutoProcess
protected function runForChannel(string $channelKey, array $cfg)
{
$watchDir = public_path($cfg['watch_dir'] ?? 'excel');
$enterUserId = (int)($cfg['enter_user_id'] ?? 0);
// $enterUserId = (int)($cfg['enter_user_id'] ?? 0);
$channelId = (int)($cfg['channel_id'] ?? 0);
$salesUserIds = $cfg['sales_user_ids'] ?? [];
// $salesUserIds = $cfg['sales_user_ids'] ?? [];
$roundRobinKey = $cfg['round_robin_key'] ?? $channelKey;
// 查分组
$group = UserGroup::where('scenario_code', $cfg['group_key'])->where('status', 1)->first();
// 查组长
$enterUserId = UserGroupMembers::where('group_id', $group->id)->where('is_leader', 1)->where('status', 1)->value('user_id');
// 查分组成员
$salesUserIds = UserGroupMembers::where('group_id', $group->id)->where('is_leader', 0)->where('status', 1)->pluck('user_id')->toArray();
if ($enterUserId <= 0 || $channelId <= 0) {
Log::error("InquiryAutoProcess: 渠道 {$channelKey} 配置缺少正确的 enter_user_id 或 channel_id,已跳过");
return;