This commit is contained in:
王炜翔 2024-09-06 21:40:31 +08:00
parent 26b4012656
commit 96aee8c2b3
2 changed files with 12 additions and 6 deletions

View File

@ -197,21 +197,21 @@ namespace asg_form.Controllers
query = query.Where(n => n.status == status); query = query.Where(n => n.status == status);
} }
var total = await query.CountAsync(); var TotalRecords = await query.CountAsync();
var rows = await query var Tasks = await query
.OrderByDescending(a => a.status) .OrderByDescending(a => a.status)
.Skip((page - 1) * limit) .Skip((page - 1) * limit)
.Take(limit) .Take(limit)
.ToListAsync(); .ToListAsync();
var result = new var result = new
{ {
TotalRecords = total, rows = Tasks ,
Tasks = rows total = TotalRecords
}; };
return Ok(result); return (result,new code_st { message = null ,status = 200});
} }
} }

View File

@ -41,7 +41,13 @@ public class MyExceptionFilter : IAsyncExceptionFilter
public class code_st
{
public string message { get; set; }
public int status { get; set; }
}
public class error_mb public class error_mb
{ {