getUserList($next)) && !empty($result['data']['openid'])) { $done += $result['count']; foreach (array_chunk($result['data']['openid'], 100) as $chunk) { if (is_array($list = $wechat->getBatchUserInfo($chunk)) && !empty($list['user_info_list'])) { foreach ($list['user_info_list'] as $user) FansService::set($user, $appid); } } $next = $result['total'] > $done ? $result['next_openid'] : null; } // 同步粉丝黑名单 list($next, $done) = ['', 0]; while (!is_null($next) && is_array($result = $wechat->getBlackList($next)) && !empty($result['data']['openid'])) { $done += $result['count']; foreach (array_chunk($result['data']['openid'], 100) as $chunk) { Db::name('WechatFans')->where(['is_black' => '0'])->whereIn('openid', $chunk)->update(['is_black' => '1']); } $next = $result['total'] > $done ? $result['next_openid'] : null; } // 同步粉丝标签 if (is_array($list = WechatService::WeChatTags()->getTags()) && !empty($list['tags'])) { foreach ($list['tags'] as &$tag) $tag['appid'] = $appid; Db::name('WechatFansTags')->where('1=1')->delete(); Db::name('WechatFansTags')->insertAll($list['tags']); } } }