mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2024-11-01 22:20:30 +08:00
优化
This commit is contained in:
parent
7112e96f54
commit
df540acb09
@ -1,7 +1,7 @@
|
|||||||
import { Inject, Provide } from '@midwayjs/decorator';
|
import { Inject, Provide } from '@midwayjs/decorator';
|
||||||
import { BaseService, CoolCommException } from '@cool-midway/core';
|
import { BaseService, CoolCommException } from '@cool-midway/core';
|
||||||
import { InjectEntityModel } from '@midwayjs/typeorm';
|
import { InjectEntityModel } from '@midwayjs/typeorm';
|
||||||
import { Repository } from 'typeorm';
|
import { In, Repository } from 'typeorm';
|
||||||
import { BaseSysUserEntity } from '../../entity/sys/user';
|
import { BaseSysUserEntity } from '../../entity/sys/user';
|
||||||
import { BaseSysPermsService } from './perms';
|
import { BaseSysPermsService } from './perms';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
@ -90,12 +90,7 @@ export class BaseSysUserService extends BaseService {
|
|||||||
* @param userIds
|
* @param userIds
|
||||||
*/
|
*/
|
||||||
async move(departmentId, userIds) {
|
async move(departmentId, userIds) {
|
||||||
await this.baseSysUserEntity
|
await this.baseSysUserEntity.update({ id: In(userIds) }, { departmentId });
|
||||||
.createQueryBuilder('a')
|
|
||||||
.update()
|
|
||||||
.set({ departmentId })
|
|
||||||
.where('a.id in (:...userIds)', { userIds })
|
|
||||||
.execute();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user