project column

This commit is contained in:
2023-04-20 02:07:19 +03:00
parent edea2cc3e7
commit 2482ae89f6
24 changed files with 737 additions and 18 deletions

View File

@@ -19,6 +19,7 @@ use yii\helpers\ArrayHelper;
* @property string $budget
* @property int $company_id
* @property int $hh_id
* @property int $owner_id
*
* @property FieldsValue[] $fieldsValues
* @property Company $company
@@ -59,6 +60,7 @@ class Project extends \yii\db\ActiveRecord
[['status'], 'exist', 'skipOnError' => true, 'targetClass' => Status::class, 'targetAttribute' => ['status' => 'id']],
[['name'], 'string', 'max' => 255],
[['budget'], 'string', 'max' => 100],
[['owner_id'], 'integer'],
[['company_id'], 'exist', 'skipOnError' => true, 'targetClass' => Company::class, 'targetAttribute' => ['company_id' => 'id']],
[['hh_id'], 'exist', 'skipOnError' => true, 'targetClass' => Hh::class, 'targetAttribute' => ['hh_id' => 'id']],
];
@@ -79,6 +81,7 @@ class Project extends \yii\db\ActiveRecord
'budget' => 'Бюджет',
'company_id' => 'Компания',
'hh_id' => 'Проект на hh.ru',
'owner_id' => 'Владелец проекта',
];
}
@@ -98,6 +101,14 @@ class Project extends \yii\db\ActiveRecord
return $this->hasOne(Company::class, ['id' => 'company_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getOwner()
{
return $this->hasOne(User::class, ['id' => 'owner_id']);
}
/**
* @return \yii\db\ActiveQuery
*/