swagger tasks
This commit is contained in:
@ -106,7 +106,7 @@ class Project extends \yii\db\ActiveRecord
|
||||
*/
|
||||
public function getColumns()
|
||||
{
|
||||
return $this->hasMany(ProjectColumn::class, ['project_id' => 'id'])->with('tasks');
|
||||
return $this->hasMany(ProjectColumn::class, ['project_id' => 'id'])->with('tasks')->where(['status' => ProjectColumn::STATUS_ACTIVE]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -123,6 +123,6 @@ class ProjectColumn extends \yii\db\ActiveRecord
|
||||
*/
|
||||
public function getTasks()
|
||||
{
|
||||
return $this->hasMany(ProjectTask::class, ['column_id' => 'id'])->with('taskUsers');
|
||||
return $this->hasMany(ProjectTask::class, ['column_id' => 'id'])->with('taskUsers')->where(['status' => ProjectTask::STATUS_ACTIVE]);
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,8 @@ use yii\helpers\ArrayHelper;
|
||||
*/
|
||||
class ProjectTask extends ActiveRecord
|
||||
{
|
||||
const STATUS_ACTIVE = 1;
|
||||
const STATUS_DISABLE = 0;
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@ -103,6 +105,17 @@ class ProjectTask extends ActiveRecord
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public static function getStatus(): array
|
||||
{
|
||||
return [
|
||||
self::STATUS_ACTIVE => 'Активен',
|
||||
self::STATUS_DISABLE => 'Выключен'
|
||||
];
|
||||
}
|
||||
|
||||
public function beforeDelete()
|
||||
{
|
||||
foreach ($this->taskUsers as $taskUser) {
|
||||
|
Reference in New Issue
Block a user