add file count to project task

This commit is contained in:
Kavalar 2024-02-02 00:06:19 +03:00
parent 2337bd75a1
commit 5cfd591140

View File

@ -182,6 +182,9 @@ class ProjectTask extends ActiveRecord
'comment_count' => function () {
return $this->getCommentCount();
},
'file_count' => function () {
return $this->getFileCount();
},
'taskUsers',
'mark',
'execution_priority'
@ -196,6 +199,14 @@ class ProjectTask extends ActiveRecord
return Comment::find()->where(['entity_id' => $this->id, 'entity_type' => 2, 'status' => Comment::STATUS_ACTIVE])->count();
}
/**
* @return bool|int|string|null
*/
public function getFileCount()
{
return FileEntity::find()->where(['entity_id' => $this->id, 'entity_type' => 2, 'status' => FileEntity::STATUS_ACTIVE])->count();
}
/**
* @return string[]
*/