This commit is contained in:
王炜翔 2025-02-18 21:36:41 +08:00
parent 17b48ce7f4
commit 7756d881e6

View File

@ -167,7 +167,7 @@ namespace asg_form.Controllers
[Route("api/v1/admin/FindBlacks")] [Route("api/v1/admin/FindBlacks")]
[HttpGet] [HttpGet]
public async Task<ActionResult<object>> FindBlacks([FromQuery]string status = null, short page = 1, short limit = 10) public async Task<ActionResult<object>> FindBlacks([FromQuery]string recordYear = null,string violator=null, short page = 1, short limit = 10)
{ {
using (TestDbContext sub = new TestDbContext()) using (TestDbContext sub = new TestDbContext())
{ {
@ -176,6 +176,8 @@ namespace asg_form.Controllers
var TotalRecords = await query.CountAsync(); var TotalRecords = await query.CountAsync();
var Tasks = await query var Tasks = await query
.Where(g => g.record_time.Contains(recordYear) && g.violator==violator)
.OrderByDescending(n => n.record_time)
.Skip((page - 1) * limit) .Skip((page - 1) * limit)
.Take(limit) .Take(limit)
.ToListAsync(); .ToListAsync();