From 940bb24d74a708be7da5a540194f5fc0acbb7716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87=E9=98=B3=20=E9=82=B9?= Date: Mon, 23 Oct 2023 17:45:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=9D=9E=E7=A9=BA=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 24Hour/Controllers/Common/LawyerservicesController.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/24Hour/Controllers/Common/LawyerservicesController.cs b/24Hour/Controllers/Common/LawyerservicesController.cs index 61af5ec..f1a2126 100644 --- a/24Hour/Controllers/Common/LawyerservicesController.cs +++ b/24Hour/Controllers/Common/LawyerservicesController.cs @@ -82,11 +82,11 @@ namespace _24Hour.Controllers.Common RefAsync totalNumber = 0;//总数据 //查询律师服务 var list = await _db.Queryable() - .WhereIF(Lawyerdata.name != null, q => q.name.Contains(Lawyerdata.name)) - .WhereIF(Lawyerdata.objectstr != null, q => q.objectstr.Contains(Lawyerdata.objectstr)) - .WhereIF(Lawyerdata.unitId != null, q => q.unitCode.Contains(Lawyerdata.unitId)) - .WhereIF(Lawyerdata.state != null, q => q.state == Lawyerdata.state) - .WhereIF(Lawyerdata.StartTime != null && Lawyerdata.EndTime != null, q => q.receptiontime >= Lawyerdata.StartTime && q.receptiontime < Lawyerdata.EndTime.Value.AddDays(1)) + .WhereIF(Lawyerdata?.name != null, q => q.name.Contains(Lawyerdata.name)) + .WhereIF(Lawyerdata?.objectstr != null, q => q.objectstr.Contains(Lawyerdata.objectstr)) + .WhereIF(Lawyerdata?.unitId != null, q => q.unitCode.Contains(Lawyerdata.unitId)) + .WhereIF(Lawyerdata?.state != null, q => q.state == Lawyerdata.state) + .WhereIF(Lawyerdata?.StartTime != null && Lawyerdata.EndTime != null, q => q.receptiontime >= Lawyerdata.StartTime && q.receptiontime < Lawyerdata.EndTime.Value.AddDays(1)) .Where(q => q.IsDeleted == 0 && q.unitCode == _userdata.unitCode).ToPageListAsync(Lawyerdata.PageIndex, Lawyerdata.PageSize, totalNumber); Lawyerdata.RowsCount = totalNumber; var data = new QueryResult(Lawyerdata, list.OrderByDescending(q => q.creationtime).ToList());