add_status_to_project_index

This commit is contained in:
SoHardKI
2019-07-02 17:35:39 +03:00
parent 45dcde26ae
commit 9affc6b402
7 changed files with 62 additions and 1 deletions

View File

@ -55,6 +55,7 @@ class Project extends \yii\db\ActiveRecord
[['name'], 'required'],
[['description'], 'string'],
[['created_at', 'updated_at'], 'safe'],
[['status'], 'exist', 'skipOnError' => true, 'targetClass' => Status::class, 'targetAttribute' => ['status' => 'id']],
[['name'], 'string', 'max' => 255],
[['budget'], 'string', 'max' => 100],
[['company_id'], 'exist', 'skipOnError' => true, 'targetClass' => Company::class, 'targetAttribute' => ['company_id' => 'id']],
@ -72,6 +73,7 @@ class Project extends \yii\db\ActiveRecord
'name' => 'Название',
'description' => 'Описание',
'created_at' => 'Дата создания',
'status' => 'Статус',
'updated_at' => 'Дата редактирования',
'budget' => 'Бюджет',
'company_id' => 'Компания',
@ -129,4 +131,9 @@ class Project extends \yii\db\ActiveRecord
$model = $this->getProjectUsers()->with('card')->all();
return ArrayHelper::getColumn($model, 'card.fio');
}
public function getStatus0()
{
return $this->hasOne(Status::class, ['id' => 'status']);
}
}