return $this->hasMany(FileUsage::className(), ['usage_id' => 'id'])
->select('f.id, f.user_id, f.type_id, f.name, f.mime, f.size, fu.usage_id')
->alias('fu')
->leftJoin('file f', 'f.id = fu.file_id')
->where(['in', 'f.type_id', $fileTypes])
->andWhere(['fu.is_deleted' => FileUsage::IS_NOT_DELETED])
->orderBy(['fu.id' => SORT_DESC])
->limit(1);
}