This commit is contained in:
2023-05-11 08:54:53 +08:00
parent 208e6258d3
commit a12824d040
3 changed files with 15 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
using JNPF.Common.Core.Manager;
using JNPF.Common.Dtos.VisualDev;
using JNPF.Common.Enums;
using JNPF.Common.Filter;
using JNPF.Common.Security;
@@ -83,23 +84,23 @@ namespace Tnb.BasicData
/// </summary>
/// <param name="parameters"></param>
[HttpPost]
public async Task<dynamic> GetValidRouteList([FromBody]PageInputBase pageInputBase)
public async Task<dynamic> GetValidRouteList([FromBody]VisualDevDataFieldDataListInput pageInput)
{
var db = _repository.AsSugarClient();
var result = await db.Queryable<BasRouteH>()
.Where(x => x.status == "1" && ((x.start_time != null && x.start_time.Value <= DateTime.Now && x.end_time != null && x.end_time.Value>=DateTime.Now)
|| (x.start_time==null && x.end_time>=DateTime.Now)
|| (x.end_time==null && x.start_time<=DateTime.Now)
|| (x.start_time == null && x.end_time == null)
))
.Select(x=>new VaildRouteOutput()
.Where(x => x.status == "1"
&& ((x.start_time != null && x.start_time.Value <= DateTime.Now && x.end_time != null && x.end_time.Value>=DateTime.Now)
|| (x.start_time==null && x.end_time>=DateTime.Now)
|| (x.end_time==null && x.start_time<=DateTime.Now)
|| (x.start_time == null && x.end_time == null)
)).Select(x=>new VaildRouteOutput()
{
id = x.id,
code = x.code,
name = x.name,
start_time = x.start_time,
end_time = x.end_time,
}).ToPagedListAsync(pageInputBase.currentPage, pageInputBase.pageSize);
start_time = x.start_time.Value.ToString("yyyy-MM-dd"),
end_time = x.end_time.Value.ToString("yyyy-MM-dd"),
}).ToPagedListAsync(pageInput.currentPage, pageInput.pageSize);
return PageResult<VaildRouteOutput>.SqlSugarPageResult(result);
}
}