@@ -133,12 +133,12 @@ export class DepartmentService {
133133 * @LastEditors : 水痕
134134 * @Description : 分页获取部门
135135 * @param {QueryDepartmentDto } queryOption
136- * @param {ICurrentUserType } currentInfo
136+ * @param {ICurrentUserType } currentUser
137137 * @return {* }
138138 */
139139 async getDepartmentPageApi (
140140 queryOption : QueryDepartmentDto ,
141- currentInfo : ICurrentUserType
141+ currentUser : ICurrentUserType
142142 ) : Promise < DepartmentPageVo > {
143143 const {
144144 status,
@@ -154,7 +154,7 @@ export class DepartmentService {
154154 if ( [ StatusEnum . NORMAL , StatusEnum . FORBIDDEN ] . includes ( status ) ) {
155155 query . set ( 'status' , Equal ( status + '' ) ) ;
156156 }
157- const { accountType, id, tenantId } = currentInfo ;
157+ const { accountType, id, tenantId } = currentUser ;
158158 /**
159159 * 1.如果是超管,查询到全部的账号
160160 * 2.如果不是超管,是主账号的时候查询下面全部的账号
@@ -172,13 +172,13 @@ export class DepartmentService {
172172 }
173173 }
174174 const total = await this . departmentRepository
175- . createQueryBuilder ( 'account ' )
175+ . createQueryBuilder ( 'department ' )
176176 . where ( mapToObj ( query ) )
177177 . getCount ( ) ;
178178 const queryBuilder = this . queryDepartmentBuilder ;
179179 const data = await queryBuilder
180180 . where ( mapToObj ( query ) )
181- . orderBy ( { accountType : 'DESC' , id : 'DESC' } )
181+ . orderBy ( { id : 'DESC' } )
182182 . offset ( ( pageNumber - 1 ) * pageSize )
183183 . limit ( pageSize )
184184 . getRawMany ( ) ;
@@ -266,14 +266,14 @@ export class DepartmentService {
266266 . addSelect ( 'department.parentId' , 'parentId' )
267267 . addSelect ( 'department.sort' , 'sort' )
268268 . addSelect ( 'department.status' , 'status' )
269- . addSelect ( 'account .createdAt' , 'createdAt' )
270- . addSelect ( 'account .updatedAt' , 'updatedAt' )
269+ . addSelect ( 'department .createdAt' , 'createdAt' )
270+ . addSelect ( 'department .updatedAt' , 'updatedAt' )
271271 . leftJoinAndMapOne (
272272 'xx' ,
273273 ( qb ) =>
274274 qb
275- . select ( 'department .id' , 'parentId' )
276- . addSelect ( 'department .title' , 'parentTitle' )
275+ . select ( 'department1 .id' , 'parentId' )
276+ . addSelect ( 'department1 .title' , 'parentTitle' )
277277 . from ( DepartmentEntity , 'department1' ) ,
278278 'department1' ,
279279 'department.parentId=department1.parentId'
0 commit comments