From 15eb82df2d6ec539e9d4245bfe08d531e8eb6379 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期日, 27 四月 2025 14:33:26 +0800
Subject: [PATCH] 修改培训订单占多个座位
---
zhengcaioa/Services/ProjectService.cs | 39 +++++++++++++++++++++++----------------
1 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/zhengcaioa/Services/ProjectService.cs b/zhengcaioa/Services/ProjectService.cs
index 7b3b87e..24c5958 100644
--- a/zhengcaioa/Services/ProjectService.cs
+++ b/zhengcaioa/Services/ProjectService.cs
@@ -348,21 +348,7 @@
}
- if (!string.IsNullOrWhiteSpace(searchEntity.NamesToubiao))
- {
- sql.Append(" and ( exists (select b.[ProjectId] from [Projectzhongbiao] b where a.[Id]=b.[ProjectId] and b.[names] like '%" + searchEntity.NamesToubiao + "%') ");
-
- sql.Append(" or exists (select c.[ProjectId] from [Projectreason] c where a.[Id]=c.[ProjectId] and c.[reasonname] like '%" + searchEntity.NamesToubiao + "%') ");
-
- sql.Append(" or exists (select d.[ProjectId] from [Projectyouxiao] d where a.[Id]=d.[ProjectId] and d.[namesyouxiao] like '%" + searchEntity.NamesToubiao + "%') ");
-
- sql.Append(" or a.[drhx] like '%" + searchEntity.NamesToubiao + "%' ");
-
- sql.Append(" or a.[dshx] like '%" + searchEntity.NamesToubiao + "%' ");
-
- sql.Append(" )");
-
- }
+
if (!string.IsNullOrWhiteSpace(searchEntity.Fencha))
{
decimal aaaa = 0;
@@ -653,7 +639,28 @@
- var query = _context.Projects
+ if (!string.IsNullOrWhiteSpace(searchEntity.NamesToubiao))
+ {
+ var sqlsss = sql.ToString();
+ sql.Append(" and ( exists (select b.[ProjectId] from [Projectzhongbiao] b where a.[Id]=b.[ProjectId] and b.[names] like '%" + searchEntity.NamesToubiao + "%') ");
+
+ sql.Append(" or exists (select c.[ProjectId] from [Projectreason] c where a.[Id]=c.[ProjectId] and c.[reasonname] like '%" + searchEntity.NamesToubiao + "%') ");
+
+ sql.Append(" or exists (select d.[ProjectId] from [Projectyouxiao] d where a.[Id]=d.[ProjectId] and d.[namesyouxiao] like '%" + searchEntity.NamesToubiao + "%') ");
+ sql.Append(" )");
+ sql.Append(" union "+ sqlsss + " and ( a.[drhx] like '%" + searchEntity.NamesToubiao + "%' ");
+
+ sql.Append(" or a.[dshx] like '%" + searchEntity.NamesToubiao + "%' ");
+ sql.Append(" )");
+
+
+ }
+
+
+
+
+
+ var query = _context.Projects
.FromSqlRaw(sql.ToString());
--
Gitblit v1.9.1