update 封装分页,排序,过滤字段
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Ewide.Core.Extension;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Furion.DatabaseAccessor.Extensions;
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.DynamicApiController;
|
||||
@@ -69,13 +70,16 @@ namespace Ewide.Core.Service
|
||||
[HttpGet("/sysApp/page")]
|
||||
public async Task<dynamic> QueryAppPageList([FromQuery] AppInput input)
|
||||
{
|
||||
var name = !string.IsNullOrEmpty(input.Name?.Trim());
|
||||
var code = !string.IsNullOrEmpty(input.Code?.Trim());
|
||||
var apps = await _sysAppRep.DetachedEntities
|
||||
.Where((name, u => EF.Functions.Like(u.Name, $"%{input.Name.Trim()}%")),
|
||||
(code, u => EF.Functions.Like(u.Code, $"%{input.Code.Trim()}%")))
|
||||
//.Where(u => u.Status == (int)CommonStatus.ENABLE)
|
||||
.ToPagedListAsync(input.PageNo, input.PageSize);
|
||||
.Where(
|
||||
!string.IsNullOrEmpty(input.Name?.Trim()),
|
||||
u => EF.Functions.Like(u.Name, $"%{input.Name.Trim()}%")
|
||||
)
|
||||
.Where(
|
||||
!string.IsNullOrEmpty(input.Code?.Trim()),
|
||||
u => EF.Functions.Like(u.Code, $"%{input.Code.Trim()}%")
|
||||
)
|
||||
.ToPageData(input);
|
||||
return XnPageResult<SysApp>.PageResult(apps);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user