|
@@ -50,15 +50,26 @@ class PushTagBind extends Command
|
|
|
$groupUsers = collect($users)->groupBy('app_id')->all();
|
|
|
foreach($groupUsers as $appId => $userList) {
|
|
|
$regIds = collect($userList)->pluck('reg_id')->all();
|
|
|
+ $app = collect($apps)->firstWhere('app_id', $appId);
|
|
|
var_dump($appId, count($regIds));
|
|
|
+
|
|
|
+ // 初始化
|
|
|
+ $appKey = getProp($app, 'app_key');
|
|
|
+ $masterSecret = getProp($app, 'master_secret');
|
|
|
+ $client = new OPPOPushCommon($appKey, $masterSecret);
|
|
|
+
|
|
|
+ // 循环绑定
|
|
|
+ if ($regIds && $client) {
|
|
|
+ foreach($regIds as $regId) {
|
|
|
+ $client->subscribeTags($regId, $tag);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
# 分页id
|
|
|
$len = count($users);
|
|
|
$id = $users[$len - 1]['id'];
|
|
|
var_dump('next id:'.$id);
|
|
|
-
|
|
|
- break;
|
|
|
}
|
|
|
}
|
|
|
|