每分钟定时轮询缓存是否有新的广告账号需要绑定 2

This commit is contained in:
hgc 2025-02-22 15:45:09 +08:00
parent 066c04a6cd
commit c076d26cbb

View File

@ -151,15 +151,20 @@ class GoogleAdsCustomers
{ {
$redisKey = 'bps:ads:new_bind_account'; //$options['token'] 即uuid 例如f47ac10b-58cc-4372-a567-0e02b2c3d479 $redisKey = 'bps:ads:new_bind_account'; //$options['token'] 即uuid 例如f47ac10b-58cc-4372-a567-0e02b2c3d479
// 获取哈希表所有字段和值 // 获取哈希表所有字段和值
if (!Redis::exists($redisKey)) {
dump('no pending uuid');
return;
}
$hashData = Redis::hGetAll($redisKey); $hashData = Redis::hGetAll($redisKey);
if (empty($hashData)) { if (empty($hashData)) {
dump('no pending bindings accounts'); dump('no pending bindings accounts');
return; return;
} }
foreach ($hashData as $uuid => $bindingStr) { foreach ($hashData as $uuid => $bindingStr) {
// 解析商户ID和账户列表 格式:"merchantId_platform_account1,account2" // 解析商户ID和账户列表 格式:"merchantId_platform_account1,account2"
[$merchantId, $platform, $accountsStr] = explode('_', $bindingStr, 3); [$merchantId, $platform, $accountsStr] = explode('_', $bindingStr, 3);
if((int)$platform !== 2){ if ((int)$platform !== 2) {
continue; continue;
} }
// 需要实际数据来源 // 需要实际数据来源