From df540acb09629f56673e412fbb3e68f3ed737e7f Mon Sep 17 00:00:00 2001 From: cool Date: Sun, 21 Jan 2024 10:57:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/base/service/sys/user.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/modules/base/service/sys/user.ts b/src/modules/base/service/sys/user.ts index 5f9dd82..7e6a412 100644 --- a/src/modules/base/service/sys/user.ts +++ b/src/modules/base/service/sys/user.ts @@ -1,7 +1,7 @@ import { Inject, Provide } from '@midwayjs/decorator'; import { BaseService, CoolCommException } from '@cool-midway/core'; import { InjectEntityModel } from '@midwayjs/typeorm'; -import { Repository } from 'typeorm'; +import { In, Repository } from 'typeorm'; import { BaseSysUserEntity } from '../../entity/sys/user'; import { BaseSysPermsService } from './perms'; import * as _ from 'lodash'; @@ -90,12 +90,7 @@ export class BaseSysUserService extends BaseService { * @param userIds */ async move(departmentId, userIds) { - await this.baseSysUserEntity - .createQueryBuilder('a') - .update() - .set({ departmentId }) - .where('a.id in (:...userIds)', { userIds }) - .execute(); + await this.baseSysUserEntity.update({ id: In(userIds) }, { departmentId }); } /**