优化xcode查询分页,必须指定排序健

This commit is contained in:
2024-05-10 09:17:01 +08:00
parent dc1fea5f95
commit 543e7d8ee7
8 changed files with 22 additions and 22 deletions
@@ -502,7 +502,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
if (!string.IsNullOrWhiteSpace(keyword))
ex &= Core.Admin._.UserName.Contains(keyword);
IList<Core.Admin> list = Core.Admin.FindAll(ex, null, null, startRowIndex, numPerPage);
IList<Core.Admin> list = Core.Admin.FindAll(ex, Admin._.Id.Desc(), null, startRowIndex, numPerPage);
totalCount = Core.Admin.FindCount(ex, null, null, startRowIndex, numPerPage);
return Content(JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
}
@@ -948,7 +948,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
}
}
IList<Member> list = Member.FindAll(ex, null, null, startRowIndex, numPerPage);
IList<Member> list = Member.FindAll(ex, Member._.Id.Desc(), null, startRowIndex, numPerPage);
totalCount = Member.FindCount(ex, null, null, startRowIndex, numPerPage);
return Content(JsonConvert.SerializeObject(new { total = totalCount, rows = list }), "text/plain");
}