rename task to project_task and task_user to project_task_user; create project_task_category, fix bug in create project method

This commit is contained in:
iIronside
2023-01-23 11:40:45 +03:00
parent 8b2bb7468c
commit 9eba04cae2
15 changed files with 521 additions and 18 deletions

View File

@ -150,4 +150,15 @@ class ProjectUser extends \yii\db\ActiveRecord
}
}
}
public static function getUsersNotOnProject($project_id): array
{
$usersIdList = ProjectUser::find()->where(['project_id' => $project_id])->select('card_id')->column();
$userCards = UserCard::find()
->where(['not in', 'id', $usersIdList])
->andWhere(['not', ['id_user' => null]])
->all();
return ArrayHelper::map($userCards, 'id', 'fio');
}
}