更新
This commit is contained in:
@@ -78,4 +78,24 @@ if (str_contains($groupSql, 'follow_users') || str_contains($groupSql, 'LIKE'))
|
||||
throw new RuntimeException('分组渠道仍在扫描 follow_users JSON');
|
||||
}
|
||||
|
||||
$historicalQuery = Db::name('qywx_external_contact_event')->alias('e');
|
||||
MediaChannelService::applyHistoricalExternalUserChannelFilter(
|
||||
$historicalQuery,
|
||||
'e.external_userid',
|
||||
[
|
||||
'source_tag_id' => 'deleted-fan-channel-id',
|
||||
'source_tag_name' => '已删粉丝渠道',
|
||||
]
|
||||
);
|
||||
$historicalSql = (string)$historicalQuery->fetchSql()->select();
|
||||
if (!str_contains($historicalSql, 'historical_channel_contact.external_userid = e.external_userid')) {
|
||||
throw new RuntimeException('已删粉丝渠道未按 external_userid 关联历史客户快照');
|
||||
}
|
||||
if (!str_contains($historicalSql, 'historical_channel_contact.follow_users LIKE')) {
|
||||
throw new RuntimeException('已删粉丝渠道未使用保留的 follow_users 快照');
|
||||
}
|
||||
if (str_contains($historicalSql, 'historical_channel_contact.delete_time IS NULL')) {
|
||||
throw new RuntimeException('已删粉丝渠道错误排除了软删客户');
|
||||
}
|
||||
|
||||
echo "MEDIA_CHANNEL_EXTERNAL_USER_FILTER_OK\n";
|
||||
|
||||
Reference in New Issue
Block a user