fix 查看当前网格分页PC
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Dlhis.Basic.WorkGrids.Request;
|
||||
using Dlhis.Basic.WorkGrids.Response;
|
||||
using Dlhis.Constants;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
@@ -66,8 +67,13 @@ public class WorkGridService : IWorkGridService
|
||||
/// <inheritdoc />
|
||||
public async Task<Pagination<WorkGridPageResponse>> GetPageAsync(WorkGridPageRequest request)
|
||||
{
|
||||
var role = _currentUser.GetRole();
|
||||
var userCode = _currentUser.GetUserClaim(UserClaimConstants.JinkoCode);
|
||||
var isAll = role is "admin" or "tenant-admin";
|
||||
|
||||
return await _dbContext.Queryable<WorkGridEntity>()
|
||||
.LeftJoin<GainfoEntity>((x, ga) => x.LeaderUserCode == ga.Code)
|
||||
.WhereIF(!isAll, x => x.LeaderUserCode == userCode)
|
||||
.Select((x, ga) => new WorkGridPageResponse
|
||||
{
|
||||
Id = x.Id,
|
||||
|
||||
Reference in New Issue
Block a user