初始化仓库
This commit is contained in:
34
common/models/Platform.php
Normal file
34
common/models/Platform.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use common\enums\StatusEnum;
|
||||
use backend\exceptions\ApiException;
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
use yii\db\ActiveRecord;
|
||||
|
||||
class Platform extends \common\modelsgii\Platform
|
||||
{
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
[
|
||||
'class' => TimestampBehavior::class,
|
||||
'attributes' => [
|
||||
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at','updated_at'],
|
||||
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
// public static function findIdentityByAccessToken($token, $type = null)
|
||||
// {
|
||||
// $platform = Platform::findOne(['token' => $token, 'status' => StatusEnum::ACTIVE]);
|
||||
// if($platform){
|
||||
// return $platform->id;
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user