mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2024-11-01 14:10:29 +08:00
优化
This commit is contained in:
parent
7112e96f54
commit
df540acb09
@ -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 });
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user