|
|
@@ -97,11 +97,10 @@ export class CompanyService extends GenericCrudService<Company> {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 删除公司 - 覆盖父类方法,改为软删除(设置status为0)
|
|
|
+ * 删除公司 - 覆盖父类方法,使用硬删除
|
|
|
*/
|
|
|
override async delete(id: number, _userId?: string | number): Promise<boolean> {
|
|
|
- // 改为软删除:设置status为0
|
|
|
- const result = await this.repository.update({ id }, { status: 0 });
|
|
|
+ const result = await this.repository.delete(id);
|
|
|
return result.affected === 1;
|
|
|
}
|
|
|
|
|
|
@@ -141,7 +140,7 @@ export class CompanyService extends GenericCrudService<Company> {
|
|
|
*/
|
|
|
async findByPlatform(platformId: number): Promise<Company[]> {
|
|
|
return this.repository.find({
|
|
|
- where: { platformId, status: 1 }
|
|
|
+ where: { platformId }
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -150,7 +149,7 @@ export class CompanyService extends GenericCrudService<Company> {
|
|
|
*/
|
|
|
async findOne(id: number): Promise<Company | null> {
|
|
|
return this.repository.findOne({
|
|
|
- where: { id, status: 1 },
|
|
|
+ where: { id },
|
|
|
relations: ['platform']
|
|
|
});
|
|
|
}
|