This commit is contained in:
Your Name
2026-09-07 10:07:47 +08:00
parent cf3fbdc5ef
commit d5164b7369
388 changed files with 19863 additions and 18720 deletions
@@ -6,6 +6,7 @@ namespace app\api\controller;
use app\adminapi\logic\qywx\CustomerLogic;
use app\common\service\qywx\QywxCustomerAcquisitionCustomerService;
use app\common\service\qywx\QywxExternalContactEventTagSnapshotService;
use app\common\service\qywx\QywxPromotionMemberSchedulerService;
use app\common\service\qywx\QywxPromotionRangeSyncService;
use app\common\service\qywx\QywxPromotionAutomationService;
@@ -140,7 +141,7 @@ class QywxExternalContactCallbackController extends BaseApiController
// 事件流水:一进来就落库(幂等),用于"今天进来多少人"等零误差统计;
// 独立于业务 UPSERT,即便后续 DB 逻辑抛错也不影响计数。
CustomerLogic::recordExternalContactEvent([
$eventId = CustomerLogic::recordExternalContactEvent([
'change_type' => $changeType,
'user_id' => $userId,
'external_userid' => $extId,
@@ -152,6 +153,8 @@ class QywxExternalContactCallbackController extends BaseApiController
]);
if ($queued) {
// 推广任务先于事件流水执行;事件落库后再用任务内不可变配置补写渠道快照。
QywxExternalContactEventTagSnapshotService::captureForPromotionEvent($eventId);
// 即时通道已尝试欢迎语/标签;分钟补偿完成备注、成员记账、范围与客户资料同步。
return;
}
@@ -227,6 +230,10 @@ class QywxExternalContactCallbackController extends BaseApiController
}
}
// 其余变更(添加/编辑/转接成功/标签变化等):以 get 详情为准 UPSERT,避免遗漏未枚举的 ChangeType
CustomerLogic::upsertSingleExternalContactFromApi($extId);
CustomerLogic::upsertSingleExternalContactFromApi(
$extId,
$changeType === 'add_external_contact' ? $eventId : 0,
$userId
);
}
}