From 9ee51bc0671775be1208d509fc951bf6ad6fe94e Mon Sep 17 00:00:00 2001 From: zzj <31836194@qq.com> Date: Wed, 24 Jan 2024 11:20:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E8=B5=84=E6=98=8E=E7=BB=86=E9=A1=B9?= =?UTF-8?q?=E6=A3=80=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Gz_Items/Gz_ItemsService.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Items/Gz_ItemsService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Items/Gz_ItemsService.cs index a0f309d19..55506c443 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Items/Gz_ItemsService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Items/Gz_ItemsService.cs @@ -81,11 +81,20 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement { try { - var strSql = new StringBuilder(); - strSql.Append("SELECT "); - strSql.Append(fieldSql); - strSql.Append(" FROM Gz_Items t "); - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), pagination); + var skip = pagination.rows * (pagination.page - 1); + var qj = queryJson.ToJObject(); + + var query = this.BaseRepository("CollegeMIS").FindList(); + if(!qj["keyword"].IsEmpty()) + { + var k = qj["keyword"].ToString(); + query = query.Where(x => x.Name.Contains(k)); + } + pagination.records = query.Count(); + + query = query.Skip(skip).Take(pagination.rows); + + return query; } catch (Exception ex) {