Fix manual-migrate command

This commit is contained in:
ErickSkrauch 2019-12-11 15:17:38 +03:00
parent dcb7345d58
commit 14661c2233

View File

@ -24,7 +24,7 @@ class ManualMigrateController extends Controller {
return (int)explode(':', $key)[2]; return (int)explode(':', $key)[2];
}, $keys); }, $keys);
/** @var OauthSession[] $sessions */ /** @var OauthSession[] $sessions */
$sessions = OauthSession::find()->andWhere(['legacy_id' => $sessionsIds]); $sessions = OauthSession::find()->andWhere(['legacy_id' => $sessionsIds])->all();
foreach ($sessions as $session) { foreach ($sessions as $session) {
if (empty($session->scopes)) { if (empty($session->scopes)) {
$session->scopes = Yii::$app->redis->smembers("oauth:sessions:{$session->legacy_id}:scopes"); $session->scopes = Yii::$app->redis->smembers("oauth:sessions:{$session->legacy_id}:scopes");