Commit d9fe1a1c authored by nanahira's avatar nanahira

add managing

parent 63eb3811
......@@ -140,6 +140,23 @@ export class Tournament extends DescBase {
@Column('int', { array: true, default: [], comment: '协作者 MC ID' })
collaborators: number[];
@QueryColumn()
@IsOptional()
@IsInt()
@IsPositive()
@ApiProperty({
description: '查询可以管理的人员 mycard id(包括创建者是,或者协作者包含)',
})
@QueryCondition((obj, qb, entityName, key) => {
if (obj[key]) {
qb.andWhere(
`(${entityName}.creator = :managing OR :managing = ANY(${entityName}.collaborators))`,
{ managing: obj[key] },
);
}
})
managing?: number;
@NotQueryable()
@NotWritable()
@Index()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment