From b81c9252cb22b7f4e8f6ab23af615ec71ed85853 Mon Sep 17 00:00:00 2001 From: Argo-MacBookPro Date: Mon, 5 Nov 2018 17:53:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81=EF=BC=9A?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=94=E5=9B=9E=E5=80=BC=E7=A7=BB=E9=99=A4check?= =?UTF-8?q?=E5=88=97=E5=87=8F=E5=B0=91=E4=BC=A0=E8=BE=93=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/Controllers/Api/GroupsController.cs | 2 +- Bootstrap.Admin/Query/QueryGroupOption.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Bootstrap.Admin/Controllers/Api/GroupsController.cs b/Bootstrap.Admin/Controllers/Api/GroupsController.cs index 72d6db33..2f454987 100644 --- a/Bootstrap.Admin/Controllers/Api/GroupsController.cs +++ b/Bootstrap.Admin/Controllers/Api/GroupsController.cs @@ -19,7 +19,7 @@ namespace Bootstrap.Admin.Controllers.Api /// /// [HttpGet] - public QueryData Get(QueryGroupOption value) + public QueryData Get(QueryGroupOption value) { return value.RetrieveData(); } diff --git a/Bootstrap.Admin/Query/QueryGroupOption.cs b/Bootstrap.Admin/Query/QueryGroupOption.cs index f12bd1a3..e09d4cfb 100644 --- a/Bootstrap.Admin/Query/QueryGroupOption.cs +++ b/Bootstrap.Admin/Query/QueryGroupOption.cs @@ -21,7 +21,7 @@ namespace Bootstrap.Admin.Query /// /// /// - public QueryData RetrieveData() + public QueryData RetrieveData() { // int limit, int offset, string name, string price, string sort, string order var data = GroupHelper.RetrieveGroups(); @@ -33,10 +33,10 @@ namespace Bootstrap.Admin.Query { data = data.Where(t => t.Description.Contains(Description)); } - var ret = new QueryData(); + var ret = new QueryData(); ret.total = data.Count(); data = Order == "asc" ? data.OrderBy(t => t.GroupName) : data.OrderByDescending(t => t.GroupName); - ret.rows = data.Skip(Offset).Take(Limit); + ret.rows = data.Skip(Offset).Take(Limit).Select(g => new { g.Id, g.GroupName, g.Description }); return ret; } }