interview back
This commit is contained in:
@ -13,6 +13,7 @@ use Yii;
|
||||
* @property int $profile_id
|
||||
* @property int $user_id
|
||||
* @property int $created_at
|
||||
* @property int $new
|
||||
* @property string $comment
|
||||
*/
|
||||
class InterviewRequest extends \yii\db\ActiveRecord
|
||||
@ -32,7 +33,7 @@ class InterviewRequest extends \yii\db\ActiveRecord
|
||||
{
|
||||
return [
|
||||
[['email'], 'required'],
|
||||
[['profile_id', 'user_id', 'created_at'], 'integer'],
|
||||
[['profile_id', 'user_id', 'created_at', 'new'], 'integer'],
|
||||
[['email', 'phone'], 'string', 'max' => 255],
|
||||
[['comment'], 'string'],
|
||||
];
|
||||
@ -53,4 +54,28 @@ class InterviewRequest extends \yii\db\ActiveRecord
|
||||
'comment' => 'Комментарий',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getProfile()
|
||||
{
|
||||
return $this->hasOne(UserCard::class, ['id' => 'profile_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getUser()
|
||||
{
|
||||
return $this->hasOne(User::class, ['id' => 'user_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool|int|string|null
|
||||
*/
|
||||
public static function getNewCount()
|
||||
{
|
||||
return self::find()->where(['new' => 1])->count();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user