Реализован функционал Mojang API

Исправлена ошибка доступа к authserver из-за перехода на использование хостов, а не доменов
This commit is contained in:
ErickSkrauch
2016-09-21 11:13:43 +03:00
parent 78e5d3e103
commit df1859f0c1
17 changed files with 576 additions and 10 deletions

View File

@@ -1,7 +1,6 @@
<?php
namespace common\models;
use Yii;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
@@ -42,4 +41,16 @@ class UsernameHistory extends ActiveRecord {
return $this->hasOne(Account::class, ['id' => 'account_id']);
}
/**
* @param int $afterTime
* @return UsernameHistory|null
*/
public function findNext(int $afterTime = null) /*: ?UsernameHistory*/ {
return self::find()
->andWhere(['account_id' => $this->account_id])
->andWhere(['>', 'applied_in', $afterTime ?: $this->applied_in])
->orderBy(['applied_in' => SORT_ASC])
->one();
}
}