fix: typo
This commit is contained in:
parent
f9f1004b19
commit
1377fbb89a
|
@ -5,7 +5,7 @@ namespace app\models;
|
||||||
class Subscription extends \yii\db\ActiveRecord
|
class Subscription extends \yii\db\ActiveRecord
|
||||||
{
|
{
|
||||||
public $user_id;
|
public $user_id;
|
||||||
public $company_id;
|
public $blog_id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -13,7 +13,7 @@ class Subscription extends \yii\db\ActiveRecord
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[['user_id'], 'required'],
|
[['user_id', 'blog_id'], 'required'],
|
||||||
[['id'], 'integer'],
|
[['id'], 'integer'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,9 @@ class Subscription extends \yii\db\ActiveRecord
|
||||||
return $this->hasOne(User::class, [ 'id' => 'user_id' ]);
|
return $this->hasOne(User::class, [ 'id' => 'user_id' ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCompany()
|
public function getBlog()
|
||||||
{
|
{
|
||||||
return $this->hasOne(Company::class, [ 'id' => 'company_id' ]);
|
return $this->hasOne(Company::class, [ 'id' => 'blog_id' ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue