|
|
@@ -32,16 +32,16 @@ namespace BPA.SAAS.Manage.Application.Org.Services |
|
|
|
public async Task<PageUtil> CompanyPage(CompanyDtoPageInput input) |
|
|
|
{ |
|
|
|
RefAsync<int> total = 0; |
|
|
|
var data =await _db.Queryable<BPA_Company, BPA_Roles>((a, b) => new JoinQueryInfos(JoinType.Inner, a.Id == b.GroupId)) |
|
|
|
.Where((a, b) => a.IsDeleted == 0) |
|
|
|
.WhereIF(!input.Name.IsNullOrEmpty(), (a, b) => a.Name.Contains(input.Name)) |
|
|
|
.WhereIF(!input.AdminName.IsNullOrEmpty(), (a, b) => a.AdminName.Contains(input.AdminName)) |
|
|
|
.WhereIF(!input.Email.IsNullOrEmpty(), (a, b) => a.Email.Contains(input.Email)) |
|
|
|
var data =await _db.Queryable<BPA_Company>() |
|
|
|
.Where((a) => a.IsDeleted == 0) |
|
|
|
.WhereIF(!input.Name.IsNullOrEmpty(), (a) => a.Name.Contains(input.Name)) |
|
|
|
.WhereIF(!input.AdminName.IsNullOrEmpty(), (a) => a.AdminName.Contains(input.AdminName)) |
|
|
|
.WhereIF(!input.Email.IsNullOrEmpty(), (a) => a.Email.Contains(input.Email)) |
|
|
|
.Filter(null, true) |
|
|
|
.Select((a, b) => new CompanyDtoInput |
|
|
|
.Select((a) => new CompanyDtoInput |
|
|
|
{ |
|
|
|
Id = a.Id.SelectAll(), |
|
|
|
SysRoleId = b.Id |
|
|
|
SysRoleId =SqlFunc.Subqueryable< BPA_Roles>().Where(x=>x.GroupId == a.Id).Select(x => x.Id), |
|
|
|
}) |
|
|
|
.OrderBy(a => a.CreateAt, OrderByType.Desc) |
|
|
|
.ToPageListAsync(input.Current, input.PageSize, total); |
|
|
|